public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* it seems a bug inside cygwin in parsing command line with double quotes and backslashes
@ 2011-12-12 13:45 Dmitry Bolshakov
  2011-12-12 17:20 ` Andrey Repin
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Bolshakov @ 2011-12-12 13:45 UTC (permalink / raw)
  To: cygwin

hi

when launching cygwin's programs from within windows's cmd
if the command line parameter has two backslashes and is double quoted (e.g. a path to local network drive)
then inside cygwin's program the corresponding ARGV element has single backslash only
but without double quotes all is ok - both backslashes are kept

simple testcase

C:\Documents and Settings\bdimych>cmd
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>c:\cygwin\bin\bash -c "set -x; : $*" -- "\\blabla"
+ : '\blabla'

C:\Documents and Settings\bdimych>c:\cygwin\bin\bash -c "set -x; : $*" -- \\blabla
+ : '\\blabla'

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>c:\Perl\bin\perl.exe -e "print $ARGV[0]" "\\blabla"
\\blabla
C:\Documents and Settings\bdimych>c:\cygwin\bin\perl.exe -e "print $ARGV[0]" "\\blabla"
\blabla
C:\Documents and Settings\bdimych>c:\cygwin\bin\perl.exe -e "print $ARGV[0]" \\blabla
\\blabla
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>c:\Ruby192\bin\ruby.exe -e "print ARGV[0]" "\\blabla"
\\blabla
C:\Documents and Settings\bdimych>c:\cygwin\bin\ruby.exe -e "print ARGV[0]" "\\blabla"
\blabla
C:\Documents and Settings\bdimych>c:\cygwin\bin\ruby.exe -e "print ARGV[0]" \\blabla
\\blabla
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>


it seems a bug somewhere inside cygwin libraries










PS

cygwin version
bdimych@bolshakovxp ~
$ uname -a
CYGWIN_NT-5.1 bolshakovxp 1.7.9(0.237/5/3) 2011-03-29 10:10 i686 Cygwin









PPS

whoops, tcl occured has no this bug
it has some initialization problems but the value has two backslashes


C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>echo puts $argv | c:\Tcl\bin\tclsh.exe - "\\blabla"
- {\\blabla}

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>echo puts $argv | c:\cygwin\bin\tclsh84.exe - "\\blabla"
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
     c:/cygwin/share/tcl8.4 c:/cygwin/share/tcl8.4 c:/cygwin/usr/share/tcl8.4 c:/share/tcl8.4 c:/cygwin/library c:/library c:/../tcl8.4.1/library



This probably means that Tcl wasn't installed properly.

- {\\blabla}

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>echo puts $argv | c:\cygwin\bin\tclsh84.exe - \\blabla
application-specific initialization failed: Can't find a usable init.tcl in the following directories:
     c:/cygwin/share/tcl8.4 c:/cygwin/share/tcl8.4 c:/cygwin/usr/share/tcl8.4 c:/share/tcl8.4 c:/cygwin/library c:/library c:/../tcl8.4.1/library



This probably means that Tcl wasn't installed properly.

- {\\blabla}

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>







PPPS

gawk has

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>c:\cygwin\bin\gawk.exe "BEGIN {print ARGV[1]; exit}" "\\blabla"
\blabla

C:\Documents and Settings\bdimych>c:\cygwin\bin\gawk.exe "BEGIN {print ARGV[1]; exit}" \\blabla
\\blabla

C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>
C:\Documents and Settings\bdimych>



-- 
With best regards
Dmitry Bolshakov

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: it seems a bug inside cygwin in parsing command line with double quotes and backslashes
  2011-12-12 13:45 it seems a bug inside cygwin in parsing command line with double quotes and backslashes Dmitry Bolshakov
@ 2011-12-12 17:20 ` Andrey Repin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Repin @ 2011-12-12 17:20 UTC (permalink / raw)
  To: Dmitry Bolshakov, cygwin

Greetings, Dmitry Bolshakov!

> when launching cygwin's programs from within windows's cmd
> if the command line parameter has two backslashes and is double quoted (e.g. a path to local network drive)
> then inside cygwin's program the corresponding ARGV element has single backslash only
> but without double quotes all is ok - both backslashes are kept

You can start right there:
http://sourceware.org/ml/cygwin/2011-06/msg00246.html

> simple testcase

Mine's simpler.


--
WBR,
Andrey Repin (anrdaemon@freemail.ru) 12.12.2011, <21:08>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-12-12 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-12 13:45 it seems a bug inside cygwin in parsing command line with double quotes and backslashes Dmitry Bolshakov
2011-12-12 17:20 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).