Mail Archives: cygwin/2000/10/18/14:16:13
--QrVcLFVTQP43pKpF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Cygwin appears to double up backslashes in arguments containing spaces
when passed from a Cygwin program (e.g., bash) to a native Win32 program:
$ foo 'C:\duda man'
argv[1] = (C:\\duda man)
^
+--- doubling
$ foo 'C:\dudaman'
argv[1] = (C:\dudaman)
However, when foo is run from cmd:
H:\> foo "C:\duda man"
argv[1] = (C:\duda man)
H:\> foo "C:\dudaman"
argv[1] = (C:\dudaman)
the doubling doesn't occur.
Note that foo.c compiled with gcc does not exhibit the doubling regardless
of the shell from which it is invoked.
See attached for foo.c.
Thanks,
Jason
P.S. The only reason that I stumbled across this, is that on Windows
98 the (non-leading) double backslashes are treated as UNC while on NT
they are not. Hence, code that was running fine on NT started failing
with ERROR_BAD_NETPATH after long delays on 98. Now I understand why
the Cygwin team holds Windows 9X in such high esteem! :,)
--
Jason Tishler
Director, Software Engineering Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation Fax: +1 (732) 264-8798
82 Bethany Road, Suite 7 Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA WWW: http://www.dothill.com
--QrVcLFVTQP43pKpF
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="foo.c"
#include <stdio.h>
int
main(int argc, char* argv[])
{
char* s = argv[1];
printf("argv[1] = (%s)\n", s);
}
--QrVcLFVTQP43pKpF
Content-Type: text/plain; charset=us-ascii
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
--QrVcLFVTQP43pKpF--
- Raw text -