[gs-bugs] [Bug 226584] Filenames with space are not allowed

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Sat Oct 22 11:12:25 UTC 2011


matteosistisette at gmail.com changed:

           What    |Removed                     |Added
                 CC|                            |matteosistisette at gmail.com

Originally reported by: burnus at users.sourceforge.net
Try to run
    ps2pdf file\ name.ps
this produces
  basename: too many arguments
  Try `basename --help' for more information.

please surround in `basename ${foo}` the ${foo} with ""

moreover you need to use "" around the $infile and $outfile" in ps2pdfwr

--- Comment #1 from L. Peter Deutsch <ghost at major2nd.com> 2000-12-31 09:47:09 UTC ---
Comment originally by lpd at users.sourceforge.net
I concur with the analysis and proposed fix. All of the utility scripts in lib/ should be reviewed to see whether they have this problem.

--- Comment #2 from Jack Moffitt <jack at artifex.com> 2001-06-04 12:26:19 UTC ---
Comment originally by undefined at users.sourceforge.net
Logged In: YES 

app: gs 7.00
os: win 2k
bat: ps2pdf.bat

i want to add that this bug also applies to the
ms-dos/windows bat files (not just the unix script as
mentioned in the original submission).

suggestion: in the "if" statements, do not enclose the
operands in quotes. i'm sure this was done because of null
strings, but the standard method of signifying a
command-line parameter containing spaces as a single
parameter is to enclose the parameter in quotes and this
wrecks havoc on the "if" statements.

you should easily see the problem with this example:
if ""postscript file.ps""==""
the parser sees the "if" keyword and expects to next see the
first operand, an operator, and then the last operand. but
instead the parser sees two consecutive operands: the null
string ("") and then the word "postscript", with no operand
imbetween. the parser throws an error.

instead signify the end of an operand with a forward slash.
(sorry for the long-winded explanation, but being more
familiar with bash scripting than win-batch scripting i
learned all this today and figured i would save someone the
headache of also searching all this out.)

--- Comment #3 from L. Peter Deutsch <ghost at major2nd.com> 2001-06-28 23:48:56 UTC ---
Comment originally by lpd at users.sourceforge.net
Logged In: YES 

A set of changes fixing this bug has been checked in to the
CVS tree.

--- Comment #4 from matteosistisette at gmail.com 2011-10-22 11:12:23 UTC ---
The bug is still there at least on linux with the gs command.
If there is a space in the input file name, it gives error (additionally, the
error message is not clear). I use backslashes to escape all spaces in file
names, as you would do with any linux command.
Even using quotes "" doesnt fix the issue.

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list