Ticket #86 (closed defect: fixed)
Yasm.exe hangs with command line that specifies a quoted include path with trailing backslash
| Reported by: | dnegrescu@… | Owned by: | |
|---|---|---|---|
| Priority: | P1 | Milestone: | |
| Component: | Misc | Version: | 0.5.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The following command line makes the assembler to act like when it is started without any parameters:
yasm -i "C:\Dev\ASM\YASM\Inc\" test.asm
but the following ones don’t:
yasm -i "C:\Dev\ASM\YASM\Inc" test.asm
yasm -i C:\Dev\ASM\YASM\Inc\ test.asm
Tested with version 0.5.0 and r1657 on Windows XP (32bit). The input file is not relevant (any file will do).
Attachments
Change History
comment:2 Changed 4 years ago by dnegrescu@…
Actually the Process Explorer shows the command line as entered. I did a little bit of debugging on this and it appears that the command line parsing done by the MS C runtime initialization code (preparing the argv and argc params) is doing some weird stuff with double quotes and backslashes and the final result is that the include path and the file name are “merged” together as one string. The end result is that the yasm command line parser will not see the input file name and will switch to read from the stdin, which gives the impression that it hanged.
While I understand that this is not Yasm’s fault, it would be nice to have a better handling of invalid command line parameters.
comment:3 Changed 4 years ago by peter
- Status changed from new to closed
- Resolution set to fixed
(In [1659]) Fix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting an error if no files are specified (instead of defaulting to stdin). While the old behavior mimiced GNU AS, the new behavior is far more common amongst typical compilers (e.g. GCC), including NASM.
While I'm here, add support for '--' (e.g. "yasm -- -f").

How exactly are you launching it with those command lines? CMD's command line parsing follows rules I'm not sure any of us mortals can understand. It's possible that the first is being interpreted as -i 'C:\Dev\ASM\YASM\Inc" test.asm'. Perhaps see what a tool like Process Explorer claims the command line is to the first one.