X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=enscript.git;a=blobdiff_plain;f=src%2Fmain.c;h=136b293dd6a3dc198fce19e038555103d83b9073;hp=347d300fc69dc556ab91fc4748bc7b5b73e49634;hb=953bc72761872478a7c60daf79a33a4dc2fd73df;hpb=e3b283efdeb7b8ffdedd520a44ec061030340670 diff --git a/src/main.c b/src/main.c index 347d300..136b293 100644 --- a/src/main.c +++ b/src/main.c @@ -1127,10 +1127,10 @@ _("library directory."))); } /* Site config. */ - (void) read_config (SYSCONFDIR, "enscriptsite.cfg"); + read_config (SYSCONFDIR, "enscriptsite.cfg"); /* Personal config. */ - (void) read_config (passwd->pw_dir, ".enscriptrc"); + read_config (cp, ".enscriptrc"); /* * Options. @@ -1544,9 +1544,13 @@ name width\theight\tllx\tlly\turx\tury\n\ buffer_append (&cmd, intbuf); buffer_append (&cmd, " "); - buffer_append (&cmd, "-Ddocument_title=\""); - buffer_append (&cmd, title); - buffer_append (&cmd, "\" "); + buffer_append (&cmd, "-Ddocument_title=\'"); + if ((cp = shell_escape (title)) != NULL) + { + buffer_append (&cmd, cp); + free (cp); + } + buffer_append (&cmd, "\' "); buffer_append (&cmd, "-Dtoc="); buffer_append (&cmd, toc ? "1" : "0"); @@ -1563,8 +1567,14 @@ name width\theight\tllx\tlly\turx\tury\n\ /* Append input files. */ for (i = optind; i < argc; i++) { - buffer_append (&cmd, " "); - buffer_append (&cmd, argv[i]); + char *cp; + if ((cp = shell_escape (argv[i])) != NULL) + { + buffer_append (&cmd, " \'"); + buffer_append (&cmd, cp); + buffer_append (&cmd, "\'"); + free (cp); + } } /* And do the job. */ @@ -1625,7 +1635,7 @@ name width\theight\tllx\tlly\turx\tury\n\ buffer_ptr (opts), buffer_len (opts)); } - buffer_append (&buffer, " \"%s\""); + buffer_append (&buffer, " \'%s\'"); input_filter = buffer_copy (&buffer); input_filter_stdin = "-"; @@ -1772,7 +1782,11 @@ name width\theight\tllx\tlly\turx\tury\n\ if (num_truncated_lines) { retval |= 2; - MESSAGE (0, (stderr, _("%d lines were %s\n"), num_truncated_lines, + MESSAGE (0, (stderr, + ngettext("1 line was %s\n", + "%d lines were %s\n", + num_truncated_lines), + num_truncated_lines, line_end == LE_TRUNCATE ? _("truncated") : _("wrapped"))); } @@ -1780,7 +1794,10 @@ name width\theight\tllx\tlly\turx\tury\n\ if (num_missing_chars) { retval |= 4; - MESSAGE (0, (stderr, _("%d characters were missing\n"), + MESSAGE (0, (stderr, + ngettext("1 character was missing\n", + "%d characters were missing\n", + num_missing_chars), num_missing_chars)); if (list_missing_characters) { @@ -1792,7 +1809,10 @@ name width\theight\tllx\tlly\turx\tury\n\ if (num_non_printable_chars) { retval |= 8; - MESSAGE (0, (stderr, _("%d non-printable characters\n"), + MESSAGE (0, (stderr, + ngettext("1 non-printable character\n", + "%d non-printable characters\n", + num_non_printable_chars), num_non_printable_chars)); if (list_missing_characters) {