[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1701-g05e794d
[email protected] (Chris Liddell) Tue, 24 Sep 2019 15:23:06 +0000 (UTC)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via 05e794d14a2853c45a08d5c49d50d1fa5cadaf6c (commit)
via 5ca729649efc3b041237b8b45bd2d011b70143ff (commit)
via d1daff4546ae8fae46fc4acb8b0bef013753488a (commit)
via 3f4fc81482ecfef51adb4af98f6ac214c7e64bdb (commit)
via f874c5b9d2d5a3798dc00e53149c4a470ce5da01 (commit)
via a1c253838b0e1ccbadc5c0bdb6e3bde59b3b00a1 (commit)
via 3147ffb314f344520fb22c8bc57d4afcdc3c9c62 (commit)
from a38bf66e8e041f21ebb25492e576262a55b318b1 (commit)
----------------------------------------------------------------------
commit 05e794d14a2853c45a08d5c49d50d1fa5cadaf6c
Author: Chris Liddell <[email protected]>
Date: Tue Sep 24 15:48:54 2019 +0100
Cope with .setsafe(global) being called when already 'SAFER'
As we default to SAFER file controls now, we want to cope with .setsafe and
.setsafeglobal being called either when already SAFER, or called multiple times.
This means adding a .currentpathcontrolstate operator so we don't try to
influence the path control lists after control is activated.
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index d04e4f8..450635f 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -2233,30 +2233,37 @@ readonly def
] def
/.lockfileaccess {
- [
- //tempfilepaths (*) .generate_dir_list_templates
- /FONTPATH .systemvar (*) .generate_dir_list_templates
- /level2dict where {
- pop
- % Default resources :
- [ currentsystemparams /GenericResourceDir get] (*) .generate_dir_list_templates
- } if
- /LIBPATH .systemvar (*) .generate_dir_list_templates
- currentuserparams /ICCProfilesDir known {
- [currentuserparams /ICCProfilesDir get] (*)
- .generate_dir_list_templates
- } if
- ] {/PermitFileReading exch .addcontrolpath} forall
+ .currentpathcontrolstate
+ {
+ (\n **** WARNING: .lockfileaccess or .setsafe called ****\n) print
+ ( **** when file access controls are already active ****\n) print flush
+ }
+ {
+ [
+ //tempfilepaths (*) .generate_dir_list_templates
+ /FONTPATH .systemvar (*) .generate_dir_list_templates
+ /level2dict where {
+ pop
+ % Default resources :
+ [ currentsystemparams /GenericResourceDir get] (*) .generate_dir_list_templates
+ } if
+ /LIBPATH .systemvar (*) .generate_dir_list_templates
+ currentuserparams /ICCProfilesDir known {
+ [currentuserparams /ICCProfilesDir get] (*)
+ .generate_dir_list_templates
+ } if
+ ] {/PermitFileReading exch .addcontrolpath} forall
- [
- //tempfilepaths (*) .generate_dir_list_templates
- ] {/PermitFileWriting exch .addcontrolpath} forall
+ [
+ //tempfilepaths (*) .generate_dir_list_templates
+ ] {/PermitFileWriting exch .addcontrolpath} forall
- [
- //tempfilepaths (*) .generate_dir_list_templates
- ] {/PermitFileControl exch .addcontrolpath} forall
+ [
+ //tempfilepaths (*) .generate_dir_list_templates
+ ] {/PermitFileControl exch .addcontrolpath} forall
- .activatepathcontrol
+ .activatepathcontrol
+ } ifelse
} bind def
/.locksafe_userparams {
@@ -2330,7 +2337,7 @@ currentdict /tempfilepaths undef
{
//.lockfileaccess exec
DELAYBIND not {
- //systemdict /SAFERUndefinePostScriptOperators get exec
+ //systemdict /SAFERUndefinePostScriptOperators .knownget {exec} if
} if
}
ifelse
@@ -2376,11 +2383,11 @@ currentdict /tempfilepaths undef
{
//.lockfileaccess exec
DELAYBIND not {
- //systemdict /SAFERUndefinePostScriptOperators get exec
+ //systemdict /SAFERUndefinePostScriptOperators .knownget {exec} if
} if
}
ifelse
-} .bind def
+} .bind executeonly odef
% If we are running in SAFER mode, lock things down
SAFER { .setsafeglobal } if
diff --git a/psi/zfile.c b/psi/zfile.c
index 9d87f45..2b7d168 100644
--- a/psi/zfile.c
+++ b/psi/zfile.c
@@ -918,6 +918,18 @@ static int zactivatepathcontrol(i_ctx_t *i_ctx_p)
gs_activate_path_control(imemory, 1);
return 0;
}
+static int zcurrentpathcontrolstate(i_ctx_t *i_ctx_p)
+{
+ os_ptr op = osp;
+ push(1);
+ if (gs_is_path_control_active(imemory)) {
+ make_true(op);
+ }
+ else {
+ make_false(op);
+ }
+ return 0;
+}
/* ------ Initialization procedure ------ */
@@ -940,6 +952,7 @@ const op_def zfile_op_defs[] =
/* Control path operators */
{"2.addcontrolpath", zaddcontrolpath},
{"0.activatepathcontrol", zactivatepathcontrol},
+ {"0.currentpathcontrolstate", zcurrentpathcontrolstate},
op_def_end(0)
};
----------------------------------------------------------------------
commit 5ca729649efc3b041237b8b45bd2d011b70143ff
Author: Chris Liddell <[email protected]>
Date: Tue Sep 24 09:18:47 2019 +0100
tiffsep(1): Cope with .tiff ending as well as .tif
diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c
index 7650c2b..5fb1025 100644
--- a/devices/gdevtsep.c
+++ b/devices/gdevtsep.c
@@ -1507,7 +1507,7 @@ copy_separation_name(tiffsep_device * pdev,
* name.
*/
static int
-length_base_file_name(tiffsep_device * pdev)
+length_base_file_name(tiffsep_device * pdev, bool *double_f)
{
int base_filename_length = strlen(pdev->fname);
@@ -1517,8 +1517,19 @@ length_base_file_name(tiffsep_device * pdev)
pdev->fname[base_filename_length - 4] == '.' &&
toupper(pdev->fname[base_filename_length - 3]) == 'T' &&
toupper(pdev->fname[base_filename_length - 2]) == 'I' &&
- toupper(pdev->fname[base_filename_length - 1]) == 'F')
+ toupper(pdev->fname[base_filename_length - 1]) == 'F') {
base_filename_length -= 4;
+ *double_f = false;
+ }
+ else if (base_filename_length > 5 &&
+ pdev->fname[base_filename_length - 5] == '.' &&
+ toupper(pdev->fname[base_filename_length - 4]) == 'T' &&
+ toupper(pdev->fname[base_filename_length - 3]) == 'I' &&
+ toupper(pdev->fname[base_filename_length - 2]) == 'F' &&
+ toupper(pdev->fname[base_filename_length - 1]) == 'F') {
+ base_filename_length -= 5;
+ *double_f = true;
+ }
#endif
#undef REMOVE_TIF_FROM_BASENAME
@@ -1532,7 +1543,8 @@ static int
create_separation_file_name(tiffsep_device * pdev, char * buffer,
uint max_size, int sep_num, bool use_sep_name)
{
- uint base_filename_length = length_base_file_name(pdev);
+ bool double_f = false;
+ uint base_filename_length = length_base_file_name(pdev, &double_f);
/*
* In most cases it is more convenient if we append '.tif' to the end
@@ -1566,9 +1578,16 @@ create_separation_file_name(tiffsep_device * pdev, char * buffer,
strcat(buffer, ")");
#if APPEND_TIF_TO_NAME
- if (max_size < strlen(buffer) + SUFFIX_SIZE)
- return_error(gs_error_rangecheck);
- strcat(buffer, ".tif");
+ if (double_f) {
+ if (max_size < strlen(buffer) + SUFFIX_SIZE + 1)
+ return_error(gs_error_rangecheck);
+ strcat(buffer, ".tiff");
+ }
+ else {
+ if (max_size < strlen(buffer) + SUFFIX_SIZE)
+ return_error(gs_error_rangecheck);
+ strcat(buffer, ".tif");
+ }
#endif
return 0;
}
@@ -2304,7 +2323,8 @@ tiffsep_print_page(gx_device_printer * pdev, gp_file * file)
int num_comp, comp_num, sep_num, code = 0, code1 = 0;
cmyk_composite_map cmyk_map[GX_DEVICE_COLOR_MAX_COMPONENTS];
char *name = NULL;
- int base_filename_length = length_base_file_name(tfdev);
+ bool double_f = false;
+ int base_filename_length = length_base_file_name(tfdev, &double_f);
int save_depth = pdev->color_info.depth;
int save_numcomps = pdev->color_info.num_components;
const char *fmt;
----------------------------------------------------------------------
commit d1daff4546ae8fae46fc4acb8b0bef013753488a
Author: Robin Watts <[email protected]>
Date: Mon Sep 23 20:04:49 2019 +0100
Recast validate to use gs_file_name_check_separator.
Avoid using gp_file_name_directory_separator, as windows can
have 2 different directory separators.
diff --git a/base/gpmisc.c b/base/gpmisc.c
index 4ffd6d5..9cca5d5 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -896,19 +896,6 @@ gp_enumerate_files_close(gs_memory_t *mem, file_enum * pfen)
*/
static int
-ends_in(const char *first, const char *last, const char *ds, size_t len)
-{
- while (len) {
- if (last < first)
- return 0; /* No match */
- if (*last != ds[--len])
- return 0; /* No match */
- last--;
- }
- return 1;
-}
-
-static int
validate(const gs_memory_t *mem,
const char *path,
gs_path_control_t type)
@@ -916,8 +903,6 @@ validate(const gs_memory_t *mem,
gs_lib_ctx_core_t *core = mem->gs_lib_ctx->core;
const gs_path_control_set_t *control;
unsigned int i, n;
- const char *ds = gp_file_name_directory_separator();
- size_t dslen = strlen(ds);
switch (type) {
case gs_permit_file_reading:
@@ -970,20 +955,21 @@ validate(const gs_memory_t *mem,
goto found;
/* Skip over anything except NUL, directory
* separator, and the next char to match. */
- while (*a && *a != ds[0] && *a != b[1])
+ while (*a && !gs_file_name_check_separator(a, 1, a) && *a != b[1])
a++;
- if (*a == 0 || *a == ds[0])
+ if (*a == 0 || *a == gs_file_name_check_separator(a, 1, a))
break; /* No match */
}
/* Continue matching */
a--; /* Subtract 1 as the loop will increment it again later */
} else if (*b == 0) {
- if (ends_in(control->paths[i], b - 1, ds, dslen)) {
+ if (b != control->paths[i] &&
+ gs_file_name_check_separator(b, -1, b)) {
const char *a2 = a;
const char *aend = path + strlen(path);
- while (aend - a2 >= dslen && memcmp(a2, ds, dslen))
+ while (aend != a2 && !gs_file_name_check_separator(a2, 1, a2))
a2++;
- if (aend - a2 < dslen)
+ if (aend != a2)
/* PATH=abc/? pattern=abc/ */
goto found; /* Bingo! */
}
----------------------------------------------------------------------
commit 3f4fc81482ecfef51adb4af98f6ac214c7e64bdb
Author: Chris Liddell <[email protected]>
Date: Mon Sep 23 18:05:00 2019 +0100
Remove spurious call to gp_validate_path_len()...
...in gx_device_open_output_file()
There is no need to validate the path in gx_device_open_output_file() as it will
be done at a lower level (gp_fopen) for paths that require it (we only validate
*after* the Postscript style %device% paths have been expanded into 'real'
paths).
This also interacts badly with the revised handling of formatted string
file names, hence remove it.
diff --git a/base/gsdevice.c b/base/gsdevice.c
index 16b0752..69fb174 100644
--- a/base/gsdevice.c
+++ b/base/gsdevice.c
@@ -1207,13 +1207,10 @@ gx_device_open_output_file(const gx_device * dev, char *fname,
char *pfname = (char *)gs_alloc_bytes(dev->memory, gp_file_name_sizeof, "gx_device_open_output_file(pfname)");
int code;
- if (gp_validate_path(dev->memory, fname, binary ? "wb" : "w") != 0)
- return gs_error_invalidfileaccess;
-
if (pfname == NULL) {
code = gs_note_error(gs_error_VMerror);
goto done;
- }
+ }
if (strlen(fname) == 0) {
code = gs_note_error(gs_error_undefinedfilename);
----------------------------------------------------------------------
commit f874c5b9d2d5a3798dc00e53149c4a470ce5da01
Author: Chris Liddell <[email protected]>
Date: Mon Sep 23 17:56:34 2019 +0100
Fix tiffsep(1) interaction with file permissions lists
The previous solution didn't quite work, when using formatted strings for
output file names (i.e. output-%d.tif).
This adds a dedicated gs_remove_outputfile_control_path() to mirror
gs_add_outputfile_control_path() and uses those for the dynamic adding and
removing of separation output file names.
diff --git a/base/gslibctx.c b/base/gslibctx.c
index 5b00d64..64e214d 100644
--- a/base/gslibctx.c
+++ b/base/gslibctx.c
@@ -683,6 +683,46 @@ gs_add_outputfile_control_path(gs_memory_t *mem, const char *fname)
}
int
+gs_remove_outputfile_control_path(gs_memory_t *mem, const char *fname)
+{
+ char *fp, f[gp_file_name_sizeof];
+ const int pipe = 124; /* ASCII code for '|' */
+ const int len = strlen(fname);
+
+ /* Be sure the string copy will fit */
+ if (len >= gp_file_name_sizeof)
+ return gs_error_rangecheck;
+ strcpy(f, fname);
+ fp = f;
+ /* Try to rewrite any %d (or similar) in the string */
+ if (!rewrite_percent_specifiers(f)) {
+ /* No %d found, so check for pipes */
+ int i;
+ fp = f;
+ for (i = 0; i < len; i++) {
+ if (f[i] == pipe) {
+ int code;
+
+ fp = &f[i + 1];
+ /* Because we potentially have to check file permissions at two levels
+ for the output file (gx_device_open_output_file and the low level
+ fopen API, if we're using a pipe, we have to add both the full string,
+ (including the '|', and just the command to which we pipe - since at
+ the pipe_fopen(), the leading '|' has been stripped.
+ */
+ code = gs_remove_control_path(mem, gs_permit_file_writing, f);
+ if (code < 0)
+ return code;
+ break;
+ }
+ if (!IS_WHITESPACE(f[i]))
+ break;
+ }
+ }
+ return gs_remove_control_path(mem, gs_permit_file_writing, fp);
+}
+
+int
gs_add_explicit_control_path(gs_memory_t *mem, const char *arg, gs_path_control_t control)
{
char *p2, *p1 = (char *)arg;
diff --git a/base/gslibctx.h b/base/gslibctx.h
index 1425014..79bc9da 100644
--- a/base/gslibctx.h
+++ b/base/gslibctx.h
@@ -243,6 +243,9 @@ int
gs_add_outputfile_control_path(gs_memory_t *mem, const char *fname);
int
+gs_remove_outputfile_control_path(gs_memory_t *mem, const char *fname);
+
+int
gs_add_explicit_control_path(gs_memory_t *mem, const char *arg, gs_path_control_t control);
int
diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c
index ec01fb3..7650c2b 100644
--- a/devices/gdevtsep.c
+++ b/devices/gdevtsep.c
@@ -1361,7 +1361,7 @@ tiffsep1_prn_close(gx_device * pdev)
}
code = gx_device_close_output_file(pdev, name, tfdev->sep_file[comp_num]);
if (code >= 0)
- code = gs_remove_control_path(pdev->memory, gs_permit_file_writing, name);
+ code = gs_remove_outputfile_control_path(pdev->memory, name);
if (code < 0) {
goto done;
}
@@ -1871,7 +1871,7 @@ tiffsep_prn_close(gx_device * pdev)
}
code = tiffsep_close_sep_file(pdevn, name, comp_num);
if (code >= 0)
- code = gs_remove_control_path(pdevn->memory, gs_permit_file_writing, name);
+ code = gs_remove_outputfile_control_path(pdevn->memory, name);
if (code < 0) {
goto done;
}
@@ -2407,13 +2407,13 @@ tiffsep_print_page(gx_device_printer * pdev, gp_file * file)
if (tfdev->sep_file[comp_num] != NULL && fmt != NULL) {
code = tiffsep_close_sep_file(tfdev, name, comp_num);
if (code >= 0)
- code = gs_remove_control_path(tfdev->memory, gs_permit_file_writing, name);
+ code = gs_remove_outputfile_control_path(tfdev->memory, name);
if (code < 0)
return code;
}
/* Open the separation file, if not already open */
if (tfdev->sep_file[comp_num] == NULL) {
- code = gs_add_control_path(tfdev->memory, gs_permit_file_writing, name);
+ code = gs_add_outputfile_control_path(tfdev->memory, name);
if (code < 0) {
goto done;
}
@@ -2637,7 +2637,7 @@ cleanup:
}
code = tiffsep_close_sep_file(tfdev, name, comp_num);
if (code >= 0)
- code = gs_remove_control_path(tfdev->memory, gs_permit_file_writing, name);
+ code = gs_remove_outputfile_control_path(tfdev->memory, name);
if (code < 0) {
code1 = code;
}
@@ -2750,7 +2750,7 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
/* Open the separation file, if not already open */
if (tfdev->sep_file[comp_num] == NULL) {
- code = gs_add_control_path(tfdev->memory, gs_permit_file_writing, name);
+ code = gs_add_outputfile_control_path(tfdev->memory, name);
if (code < 0) {
goto done;
}
@@ -2913,7 +2913,7 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
}
code = tiffsep_close_sep_file((tiffsep_device *)tfdev, name, comp_num);
if (code >= 0)
- code = gs_remove_control_path(tfdev->memory, gs_permit_file_writing, name);
+ code = gs_remove_outputfile_control_path(tfdev->memory, name);
if (code < 0) {
code1 = code;
}
----------------------------------------------------------------------
commit a1c253838b0e1ccbadc5c0bdb6e3bde59b3b00a1
Author: Robin Watts <[email protected]>
Date: Mon Sep 23 17:11:47 2019 +0100
Update path validation to accept multiple *'s as special case.
Previously we interpretted multiple *'s as meaning the same as
single *'s. Now we use them to mean "just those chars that
might be created by the use of a %...{d,x,u,i,o,X} format
specifier".
diff --git a/base/gpmisc.c b/base/gpmisc.c
index 88a09c6..4ffd6d5 100644
--- a/base/gpmisc.c
+++ b/base/gpmisc.c
@@ -946,22 +946,37 @@ validate(const gs_memory_t *mem,
/* PATH=abc pattern=abcd */
break; /* No match */
} else if (*b == '*') {
- /* Skip over multiple '*'s - this is intended to
- * make life easier for the code constructing
- * patterns from OutputFile definitions. */
- while (b[1] == '*')
+ if (b[1] == '*') {
+ /* Multiple '*'s are taken to mean the
+ * output from a printf. */
b++;
- if (b[1] == 0)
- /* PATH=abc???? pattern=abc* */
- goto found;
- /* Skip over anything except NUL, directory
- * separator, and the next char to match. */
- while (*a && *a != ds[0] && *a != b[1])
- a++;
- if (*a == 0 || *a == ds[0])
- break; /* No match */
+ while (b[1] == '*')
+ b++;
+ /* Skip over the permissible matching chars */
+ while (*a &&
+ ((*a == ' ' || *a == '-' || *a == '+' ||
+ (*a >= '0' && *a <= '9') ||
+ (*a >= 'a' && *a <= 'f') ||
+ (*a >= 'A' && *a <= 'F'))))
+ a++;
+ if (b[1] == 0 && *a == 0)
+ /* PATH=abc<%d> pattern=abc** */
+ goto found;
+ if (*a == 0)
+ break; /* No match */
+ } else {
+ if (b[1] == 0)
+ /* PATH=abc???? pattern=abc* */
+ goto found;
+ /* Skip over anything except NUL, directory
+ * separator, and the next char to match. */
+ while (*a && *a != ds[0] && *a != b[1])
+ a++;
+ if (*a == 0 || *a == ds[0])
+ break; /* No match */
+ }
/* Continue matching */
- a--;
+ a--; /* Subtract 1 as the loop will increment it again later */
} else if (*b == 0) {
if (ends_in(control->paths[i], b - 1, ds, dslen)) {
const char *a2 = a;
diff --git a/doc/Use.htm b/doc/Use.htm
index 943a134..88c33c7 100644
--- a/doc/Use.htm
+++ b/doc/Use.htm
@@ -3550,6 +3550,10 @@ and on MS Windows it is ";").
</li>
</ul>
<p>
+'*' may be used as a wildcard in the above paths to mean "any
+character other than the directory separator. Do not use two
+or more *'s without intervening characters.
+<p>
Finally, paths supplied on the command line (such as those in <code>-I</code>,
<code>-sFONTPATH</code> parameters) are added to the permitted reading list.
Similarly, paths read during initialisation from <code>Fontmap</code>, <code>cidfmap</code>,
----------------------------------------------------------------------
commit 3147ffb314f344520fb22c8bc57d4afcdc3c9c62
Author: Robin Watts <[email protected]>
Date: Mon Sep 23 16:41:09 2019 +0100
Improve OutputFile handling of %d etc.
Only accept %d (and friends) (as opposed to anything starting with %).
Only accept legal combinations of flags/widths/precision etc.
Generate a more conservative wildcard.
diff --git a/base/gslibctx.c b/base/gslibctx.c
index 855a1b4..5b00d64 100644
--- a/base/gslibctx.c
+++ b/base/gslibctx.c
@@ -577,6 +577,64 @@ gs_check_file_permission (gs_memory_t *mem, const char *fname, const int len, co
return code;
}
+static int
+rewrite_percent_specifiers(char *s)
+{
+ char *match_start;
+
+ while (*s)
+ {
+ int flags;
+ /* Find a % */
+ while (*s && *s != '%')
+ s++;
+ if (*s == 0)
+ return 0;
+ match_start = s;
+ s++;
+ /* Skip over flags (just one instance of any given flag, in any order) */
+ flags = 0;
+ while (*s) {
+ if (*s == '-' && (flags & 1) == 0)
+ flags |= 1;
+ else if (*s == '+' && (flags & 2) == 0)
+ flags |= 2;
+ else if (*s == ' ' && (flags & 4) == 0)
+ flags |= 4;
+ else if (*s == '0' && (flags & 8) == 0)
+ flags |= 8;
+ else if (*s == '#' && (flags & 16) == 0)
+ flags |= 16;
+ else
+ break;
+ s++;
+ }
+ /* Skip over width */
+ while (*s >= '0' && *s <= '9')
+ s++;
+ /* Skip over .precision */
+ if (*s == '.' && s[1] >= '0' && s[1] <= '9') {
+ s++;
+ while (*s >= '0' && *s <= '9')
+ s++;
+ }
+ /* Skip over 'l' */
+ if (*s == 'l')
+ s++;
+ if (*s == 'd' ||
+ *s == 'i' ||
+ *s == 'u' ||
+ *s == 'o' ||
+ *s == 'x' ||
+ *s == 'X') {
+ /* Success! */
+ memset(match_start, '*', s - match_start + 1);
+ return 1;
+ }
+ }
+ return 0;
+}
+
/* For the OutputFile permission we have to deal with formattable strings
i.e. ones that have "%d" or similar in them. For these we want to replace
everything after the %d with a wildcard "*".
@@ -587,18 +645,18 @@ gs_check_file_permission (gs_memory_t *mem, const char *fname, const int len, co
int
gs_add_outputfile_control_path(gs_memory_t *mem, const char *fname)
{
- char *fp, f[gp_file_name_sizeof] = {0};
- const int percent = 37; /* ASCII code for '%' */
+ char *fp, f[gp_file_name_sizeof];
const int pipe = 124; /* ASCII code for '|' */
const int len = strlen(fname);
- strncpy(f, fname, len);
- fp = strchr(f, percent);
- if (fp != NULL) {
- fp[0] = '*';
- fp[1] = '\0';
- fp = f;
- } else {
+ /* Be sure the string copy will fit */
+ if (len >= gp_file_name_sizeof)
+ return gs_error_rangecheck;
+ strcpy(f, fname);
+ fp = f;
+ /* Try to rewrite any %d (or similar) in the string */
+ if (!rewrite_percent_specifiers(f)) {
+ /* No %d found, so check for pipes */
int i;
fp = f;
for (i = 0; i < len; i++) {
Summary of changes:
Resource/Init/gs_init.ps | 55 ++++++++++++----------
base/gpmisc.c | 65 +++++++++++++-------------
base/gsdevice.c | 5 +-
base/gslibctx.c | 116 +++++++++++++++++++++++++++++++++++++++++++----
base/gslibctx.h | 3 ++
devices/gdevtsep.c | 48 ++++++++++++++------
doc/Use.htm | 4 ++
psi/zfile.c | 13 ++++++
8 files changed, 226 insertions(+), 83 deletions(-)