flat assembler
Message board for the users of flat assembler.
Index
> Windows > why windows add a new extra spacebar before argument? |
Author |
|
revolution 16 Apr 2012, 21:39
Why do birds sing?
Why is rain wet? |
|||
16 Apr 2012, 21:39 |
|
AsmGuru62 16 Apr 2012, 22:00
Parser of a command line must not rely on fact that every piece will be
separated by only one blank - it can be 10 blanks or 7 or whatever. Also, blanks can be enclosed into double quotes and then they considered a part of the command line token: A.EXE "C:\Program Files\Microsoft" -del |
|||
16 Apr 2012, 22:00 |
|
Goplat 19 Apr 2012, 01:38
cmd allows several characters other than space to terminate a program name and begin its arguments (most usefully, the slash), but the C library's rules for parsing command lines requires a space, so cmd adds one:
program/foo → CreateProcess("C:\program.exe", "program /foo", ...) program;foo → CreateProcess("C:\program.exe", "program ;foo", ...) program(foo → CreateProcess("C:\program.exe", "program (foo", ...) If the character *is* a space, this means there ends up being two spaces in the command line passed to CreateProcess. Edit: It seems this behavior changed between XP and Vista. XP's cmd removes the extra space, Vista's does not. |
|||
19 Apr 2012, 01:38 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.