Bug 691622

Summary: ps2pdf fails with an option and a single argument
Product: Ghostscript Reporter: Alex Cherepanov <alex>
Component: GeneralAssignee: Alex Cherepanov <alex>
Status: RESOLVED FIXED    
Severity: normal CC: mwtoews
Priority: P4    
Version: master   
Hardware: PC   
OS: Windows NT   
Customer: Word Size: ---

Description Alex Cherepanov 2010-09-17 04:14:52 UTC
For long time our BAT files couldn't identify options reliably.
With introduction of some BAT language extensions one can check for
the leading '-' as following:

--- gs/lib/ps2pdf.bat   (revision 11725)
+++ gs/lib/ps2pdf.bat   (working copy)
@@ -16,5 +16,9 @@
 echo %1 >> "%TEMP%\_.at"
 shift
 :bot
-if not %3/==/ goto top
+rem Search for leading '-'
+echo %1 | findstr /b /C:- >nul 2>&1
+if ERRORLEVEL 1 goto proc
+goto top
+:proc
 call "%LIBDIR%ps2pdfxx.bat" %1 %2
Comment 1 Ray Johnston 2010-09-23 16:47:20 UTC
Assigning to Alex -- he seems to have a handle on Windows batch files.
Comment 2 Alex Cherepanov 2010-09-25 02:12:58 UTC
This and similar patches to ps2pdf12.bat, ps2pdf13.bat, ps2pdf14.bat 
have been committed as a rev. 11743.

Other batch files don't have a single-argument form and work just fine
by counting the arguments.
Comment 3 Alex Cherepanov 2010-12-13 03:40:13 UTC
*** Bug 689682 has been marked as a duplicate of this bug. ***