*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
%{
static MsgInfo *msginfo = NULL;
static gboolean *visible = NULL;
+static gboolean dry_run = FALSE;
static gint maxsize = 0;
static gint stacksize = 0;
static const gchar *body = NULL;
static gint error = 0;
-static gint cursor_pos = 0;
+static gint cursor_pos = -1;
extern int quote_fmt_firsttime;
}
void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str,
- const gchar *my_body)
+ const gchar *my_body, gboolean my_dry_run)
{
quote_str = my_quote_str;
body = my_body;
msginfo = info;
+ dry_run = my_dry_run;
stacksize = 0;
add_visibility(TRUE);
if (buffer != NULL)
* force LEX initialization
*/
quote_fmt_firsttime = 1;
- cursor_pos = 0;
+ cursor_pos = -1;
}
void quote_fmterror(char *str)
p = msginfo->fromname;
cur = tmp;
while (*p) {
- if (*p && isalnum(*p)) {
+ if (*p && g_utf8_validate(p, 1, NULL)) {
*cur = toupper(*p);
cur++;
len++;
insert:
INSERT_FILE OPARENT string CPARENT
{
- quote_fmt_insert_file($3);
+ if (!dry_run) {
+ quote_fmt_insert_file($3);
+ }
}
| INSERT_PROGRAMOUTPUT OPARENT string CPARENT
{
- quote_fmt_insert_program_output($3);
+ if (!dry_run) {
+ quote_fmt_insert_program_output($3);
+ }
};