[gs-cvs] rev 7001 - trunk/gs/src
ray at ghostscript.com
ray at ghostscript.com
Sat Aug 19 10:33:54 PDT 2006
Author: ray
Date: 2006-08-19 10:33:54 -0700 (Sat, 19 Aug 2006)
New Revision: 7001
Modified:
trunk/gs/src/gpmisc.c
Log:
Revert previous change that could cause an infinite loop until I can
figure out this "file_name_combine" logic in order to handle the %device%
syntax without the hang.
Modified: trunk/gs/src/gpmisc.c
===================================================================
--- trunk/gs/src/gpmisc.c 2006-08-18 10:34:25 UTC (rev 7000)
+++ trunk/gs/src/gpmisc.c 2006-08-19 17:33:54 UTC (rev 7001)
@@ -120,8 +120,6 @@
* directory references from the concatenation when possible.
* The trailing zero byte is being added.
*
- * Also tolerates/skips leading IODevice specifiers such as %os% or %rom%
- *
* Examples :
* "/gs/lib" + "../Resource/CMap/H" --> "/gs/Resource/CMap/H"
* "C:/gs/lib" + "../Resource/CMap/H" --> "C:/gs/Resource/CMap/H"
@@ -131,8 +129,6 @@
* "DUA1:[GHOSTSCRIPT.RESOURCE.CMAP]H"
* "\\server\share/a/b///c/../d.e/./" + "../x.e/././/../../y.z/v.v" -->
* "\\server\share/a/y.z/v.v"
- * "%rom%lib/" + "gs_init.ps" --> "%rom%lib/gs_init.ps
- * "" + "%rom%lib/gs_init.ps" --> "%rom%lib/gs_init.ps"
*/
gp_file_name_combine_result
gp_file_name_combine_generic(const char *prefix, uint plen, const char *fname, uint flen,
@@ -145,22 +141,12 @@
*/
char *bp = buffer, *bpe = buffer + *blen;
const char *ip, *ipe;
- uint slen = 0; /* initial use is as flag: 0 != no prefix */
+ uint slen;
uint infix_type = 0; /* 0=none, 1=current, 2=parent. */
uint infix_len = 0;
- uint rlen = 0;
+ uint rlen = gp_file_name_root(fname, flen);
+ /* We need a special handling of infixes only immediately after a drive. */
- /* Check for IODevice first since 'root' specifiers will follow %os% */
- /* Note that IODevices are platform independent */
- if (fname[0] == '%') {
- slen = 1; /* IODevices never append/insert the prefix */
- for (rlen=1; rlen < flen; rlen++)
- if (fname[rlen] == '%')
- break;
- }
- rlen += gp_file_name_root(fname+rlen, flen-rlen);
- /* We need a special handling of infixes only immediately after a drive.
- * or IODevice (such as %os%) */
if (rlen != 0) {
/* 'fname' is absolute, ignore the prefix. */
ip = fname;
@@ -173,7 +159,7 @@
}
if (!append(&bp, bpe, &ip, rlen))
return gp_combine_small_buffer;
- slen += gs_file_name_check_separator(bp, buffer - bp, bp); /* Backward search. */
+ slen = gs_file_name_check_separator(bp, buffer - bp, bp); /* Backward search. */
if (rlen != 0 && slen == 0) {
/* Patch it against names like "c:dir" on Windows. */
const char *sep = gp_file_name_directory_separator();
More information about the gs-cvs
mailing list