[gs-cvs] rev 7108 - in trunk/gs: lib src

leonardo at ghostscript.com leonardo at ghostscript.com
Mon Oct 16 05:50:05 PDT 2006


Author: leonardo
Date: 2006-10-16 05:50:05 -0700 (Mon, 16 Oct 2006)
New Revision: 7108

Modified:
   trunk/gs/lib/gs_res.ps
   trunk/gs/src/zfile.c
   trunk/gs/src/zfile1.c
Log:
Fix (Resource machinery) : Improve working with ROM file system.

DETAILS :

1. Consider %iodevice% paths as absolute when combining a resource file name (gs_res.ps).
2. A minor code cleanup : Remove gp_file_name_combine_patch
   (an algorithmically equivalent change).
3. A minor code cleanup : Improve zfile_name_is_absolute
   (an algorithmically equivalent change).

EXPECTED DIFFERENCES :

None.


Modified: trunk/gs/lib/gs_res.ps
===================================================================
--- trunk/gs/lib/gs_res.ps	2006-10-15 17:19:45 UTC (rev 7107)
+++ trunk/gs/lib/gs_res.ps	2006-10-16 12:50:05 UTC (rev 7108)
@@ -494,6 +494,16 @@
 	{ forall } 0 get
   	currentdict end 2 .execn begin
 } bind
+/.file_name_is_iodevice_or_absolute
+{ {
+    dup length 0 gt {
+      dup 0 get (%) 0 get eq {
+        pop true exit
+      } if
+    } if
+    .file_name_is_absolute exit
+  } loop
+} bind def
 /ResourceFileName
 	  {                                             % /in (scr)
 	    exch //.rfnstring cvs                       % (scr) (n)
@@ -501,7 +511,7 @@
             Category .namestring                        % (scr) (/) (n) (c)
             3 1 roll                                    % (scr) (c) (/) (n)
 	    concatstrings concatstrings                 % (scr) (c/n)
-            /GenericResourceDir getsystemparam .file_name_is_absolute not {
+            /GenericResourceDir getsystemparam //.file_name_is_iodevice_or_absolute exec not {
               /GenericResourceDir getsystemparam exch concatstrings
 	      findlibfile
 	      {                                         % (scr) (p/c/n) file

Modified: trunk/gs/src/zfile.c
===================================================================
--- trunk/gs/src/zfile.c	2006-10-15 17:19:45 UTC (rev 7107)
+++ trunk/gs/src/zfile.c	2006-10-16 12:50:05 UTC (rev 7108)
@@ -885,13 +885,6 @@
     }
 }
 
-private gp_file_name_combine_result 
-gp_file_name_combine_patch(const char *prefix, uint plen, const char *fname, uint flen, 
-			    bool no_sibling, char *buffer, uint *blen)
-{
-    return gp_file_name_combine(prefix, plen, fname, flen, no_sibling, buffer, blen);
-}
-
 private int
 check_file_permissions_aux(i_ctx_t *i_ctx_p, char *fname, uint flen)
 {   /* i_ctx_p is NULL running init files. */
@@ -985,7 +978,7 @@
 		*pclen = plen + flen;
 		return 0;
 	    } else {
-		r = gp_file_name_combine_patch(pstr, plen, 
+		r = gp_file_name_combine(pstr, plen, 
 			fname, flen, false, buffer, &blen1);
 		if (r != gp_combine_success)
 		    continue;

Modified: trunk/gs/src/zfile1.c
===================================================================
--- trunk/gs/src/zfile1.c	2006-10-15 17:19:45 UTC (rev 7107)
+++ trunk/gs/src/zfile1.c	2006-10-16 12:50:05 UTC (rev 7108)
@@ -73,8 +73,8 @@
 {   os_ptr op = osp;
 
     check_type(op[0], t_string);
-    make_bool(op, (gp_file_name_root((const char *)op->value.const_bytes, 
-					r_size(op)) > 0));
+    make_bool(op, gp_file_name_is_absolute((const char *)op->value.const_bytes, 
+					r_size(op)));
     return 0;
 }
 



More information about the gs-cvs mailing list