[gs-cvs] rev 7144 - trunk/gs/src
alexcher at ghostscript.com
alexcher at ghostscript.com
Tue Oct 31 15:21:22 PST 2006
Author: alexcher
Date: 2006-10-31 15:21:22 -0800 (Tue, 31 Oct 2006)
New Revision: 7144
Modified:
trunk/gs/src/gsfname.c
trunk/gs/src/zfile.c
Log:
Change the order of argument checking in renamefile operator and the error
code returned for renaming bare devices such as (%stdin) to match CET 23-23.ps
Modified: trunk/gs/src/gsfname.c
===================================================================
--- trunk/gs/src/gsfname.c 2006-10-31 21:30:03 UTC (rev 7143)
+++ trunk/gs/src/gsfname.c 2006-10-31 23:21:22 UTC (rev 7144)
@@ -70,8 +70,8 @@
if (code < 0)
return code;
- if (pfn->len == 0)
- return_error(gs_error_invalidfileaccess); /* device only */
+ if (pfn->len == 0) /* device only */
+ return_error(gs_error_undefinedfilename); /* for CET 23-23.ps */
return gs_terminate_file_name(pfn, mem, cname);
}
Modified: trunk/gs/src/zfile.c
===================================================================
--- trunk/gs/src/zfile.c 2006-10-31 21:30:03 UTC (rev 7143)
+++ trunk/gs/src/zfile.c 2006-10-31 23:21:22 UTC (rev 7144)
@@ -421,15 +421,16 @@
private int
zrenamefile(i_ctx_t *i_ctx_p)
{
+ int code;
os_ptr op = osp;
gs_parsed_file_name_t pname1, pname2;
- int code = parse_real_file_name(op - 1, &pname1, imemory,
- "renamefile(from)");
+ code = parse_real_file_name(op, &pname2, imemory, "renamefile(to)");
if (code < 0)
return code;
- pname2.fname = 0;
- code = parse_real_file_name(op, &pname2, imemory, "renamefile(to)");
+
+ pname1.fname = 0;
+ code = parse_real_file_name(op - 1, &pname1, imemory, "renamefile(from)");
if (code >= 0) {
if (pname1.iodev != pname2.iodev ) {
if (pname1.iodev == iodev_default)
More information about the gs-cvs
mailing list