This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cygwin1-20000811: exec*() quoting backslashes for args containing spaces?


(Note: I am not on this mailing list, so if you reply to this message,
please be sure to CC me.)

Put this in foo.pl:

	$" = "\n";
	print "@ARGV\n";

Now in a cygwin window run:

	perl foo.pl '\foo bar' '\foobar'

You SHOUlD see this:

	\foo bar
	\foobar

Instead, you'll see this:

	\\foo bar
	\foobar

The space appears to be the kicker -- when an argument has spaces in
it, the exec*() functions in cygwin1.dll quote the backslashes in it
before passing it to the called process.  This doesn't happen if there
are no spaces.  This seems rather broken.

The reason why I believe that cygwin1.dll is doing the bogus quoting
is because it happens whether you run the command from bash or ash.

I confirmed that this problem exists with two different cygwin1.dll's,
including the cygwin1-20000811 snapshot.  Here's the output of
"cygcheck -s -v -r" for that one:

		      *************************

Cygnus Win95/NT Configuration Diagnostics
Current System Time: Wed Aug 16 11:19:14 2000

WinNT Ver 4.0 build 1381 Service Pack 6

Path:	/c/Program Files/Intel/Compiler4.0/bin
	/c/Program Files/Microsoft Visual Studio/Common/msdev98/BIN
	/c/Program Files/Microsoft Visual Studio/VC98/BIN
	/c/Program Files/Microsoft Visual Studio/Common/TOOLS
	/c/Program Files/Microsoft Visual Studio/Common/TOOLS/WINNT
	/usr/local/bin
	/usr/bin
	/usr/local/bin
	/c/Program Files/Microsoft Visual Studio/vt6/bin
	/c/Program Files/Microsoft Visual Studio/common/msdev98/bin
	/c/Program Files/Microsoft Visual Studio/msdn98/98vs/1033/setup
	/c/Perl/bin
	/usr/bin
	/c/WINNT/system32
	/c/WINNT
	/c/Program Files/InstallShield/InstallShield 5.5 Professional Edition/Program

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

CYGWIN = `binmode tty nontsec'
HOME = `/m'
MAKE_MODE = `unix'
PWD = `/c/tmp'

!C: = `C:\WINNT\Profiles\jik\Desktop'
COMPUTERNAME = `VOLTRON'
COMSPEC = `C:\WINNT\system32\cmd.exe'
ESHELL = `bash.exe'
HOMEDRIVE = `C:'
HOMEPATH = `\'
HOSTNAME = `VOLTRON'
HOSTTYPE = `i586'
INCLUDE = `c:\Program Files\Intel\Compiler4.0\include;c:\Program Files\Microsoft Visual Studio\VC98\ATL\INCLUDE;c:\Program Files\Microsoft Visual Studio\VC98\INCLUDE;c:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE;C:\Program Files\Microsoft Visual Studio\vt6\include;'
LIB = `c:\Program Files\Intel\Compiler4.0\lib;c:\Program Files\Microsoft Visual Studio\VC98\LIB;c:\Program Files\Microsoft Visual Studio\VC98\MFC\LIB;C:\Program Files\Microsoft Visual Studio\vt6\lib;'
LOGONSERVER = `\\VOLTRON'
MACHTYPE = `i586-pc-cygwin32'
MAIL = `/m/Mailbox'
MSDevDir = `c:\Program Files\Microsoft Visual Studio\Common\msdev98'
MSVCDir = `c:\Program Files\Microsoft Visual Studio\VC98'
NUMBER_OF_PROCESSORS = `1'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
OS = `Windows_NT'
OSTYPE = `cygwin32'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 8 Stepping 1, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0801'
PROMPT = `$P$G'
SHELL = `/bin/sh'
SHLVL = `1'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `/c/TEMP'
TERM = `cygwin'
TMP = `/c/TEMP'
USERDOMAIN = `VOLTRON'
USERNAME = `jik'
USERPROFILE = `C:\WINNT\Profiles\jik'
WINDIR = `C:\WINNT'
_ = `/usr/bin/cygcheck'
TZ = `EST5EDT4,M4.1.0/2,M10.5.0/2'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
  (default) = `u:'
  unix = `/u'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `s:'
  unix = `/software'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `p:'
  unix = `/projects'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `m:'
  unix = `/m'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `d:'
  unix = `/d'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
  (default) = `c:'
  unix = `/'
  fbinary = 0x00000001
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Installed Components
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Installed Components\c:/cygwin
  (default) = `0000'
  bash = `0002.0004.0001'
  binutils = `20000722.0001'
  bison = `0000'
  byacc = `0000'
  bzip = `0000'
  clear = `0001.0000'
  crypt = `0001.0000'
  cygwin = `0001.0001.0003.0001'
  dejagnu = `0000'
  diff = `0000'
  expect = `0000'
  fileutils = `0000'
  findutils = `0000'
  flex = `0000'
  gawk = `0003.0000.0004'
  gcc = `0002.0095.0002.0002'
  gdb = `20000610'
  gperf = `0000'
  grep = `0000'
  groff = `0001.011a.0001'
  gzip = `0000'
  inetutils = `0001.0003.0002.05p1'
  less = `0000'
  libpng = `0001.0000.0006.0001'
  login = `0001.0004.0001'
  m = `0000'
  make = `0003.0079.0003'
  man = `0001.005g.0002'
  mt = `0001.0009.0001'
  curlstuff = `0000'
  opengl = `0001.0002.0001.0001'
  patch = `0000'
  sed = `0003.0002.0001'
  shellutils = `0000'
  tar = `0000'
  tcltk = `20000610'
  termcap = `20000630'
  texinfo = `0000'
  textutils = `0002.0000.0001'
  time = `0000'
  vim = `0005.0007.0004'
  zlib = `0001.0001.0003.0001'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `c:\cygwin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/c
  (default) = `c:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/d
  (default) = `d:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/m
  (default) = `m:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/projects
  (default) = `p:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/software
  (default) = `s:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/u
  (default) = `u:'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `c:\cygwin\bin'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `c:\cygwin\lib'
  flags = 0x0000000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20\B20.1
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32\cygwin-B20.1
  (default) = `c:\cygnus\cygwin-b20'
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cygnus Cygwin B20
  (default) = `C:\WINNT\IsUninst.exe -fc:\cygnus\cygwin-b20\Uninst.isu'
  DisplayName = `Cygwin B20'

a:  fd           N/A    N/A                    
c:  hd  NTFS    2047Mb  83% CP CS UN PA FC     
d:  hd  NTFS    2604Mb  44% CP CS UN PA FC     
e:  cd           N/A    N/A                    
m:  net NTFS    7051Mb  98%          PA        jik
p:  net NTFS    2524Mb  76%          PA        projects
s:  net NTFS   17240Mb  88%          PA        software
t:  net NTFS   17240Mb  88%          PA        tools
u:  net NTFS     159Mb  63%          PA        u

c:\cygwin\bin  /usr/bin  system  binmode
c:\cygwin\lib  /usr/lib  system  binmode
c:\cygwin  /        system  binmode
c:    /c       system  binmode
d:    /d       system  binmode
m:    /m       system  binmode
p:    /projects  system  binmode
s:    /software  system  binmode
u:    /u       system  binmode

Found: c:\cygwin\usr\local\bin\bash.exe
Found: c:\cygwin\bin\bash.exe
Warning: c:\cygwin\usr\local\bin\bash.exe hides c:\cygwin\bin\bash.exe
Found: \bin\bash.exe
Warning: c:\cygwin\usr\local\bin\bash.exe hides \bin\bash.exe
Found: c:\cygwin\bin\cat.exe
Found: c:\cygwin\bin\cpp.exe
Found: c:\cygwin\bin\find.exe
Found: c:\cygwin\bin\gcc.exe
Found: c:\cygwin\bin\gdb.exe
Found: c:\cygwin\bin\ld.exe
Found: c:\cygwin\bin\ls.exe
Found: c:\cygwin\bin\make.exe
Found: c:\cygwin\bin\sh.exe
Found: \bin\sh.exe
Warning: c:\cygwin\bin\sh.exe hides \bin\sh.exe

   83k 2000/06/11 c:\cygwin\bin\cygitcl30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitcl30.dll" v0.0 ts=2000/6/10 23:34
   35k 2000/06/11 c:\cygwin\bin\cygitk30.dll - os=4.0 img=1.0 sys=4.0
                  "cygitk30.dll" v0.0 ts=2000/6/10 23:34
  402k 2000/06/11 c:\cygwin\bin\cygtcl80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtcl80.dll" v0.0 ts=2000/6/10 23:30
    5k 2000/06/11 c:\cygwin\bin\cygtclpip80.dll - os=4.0 img=1.0 sys=4.0
   10k 2000/06/11 c:\cygwin\bin\cygtclreg80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=2000/6/10 23:30
  639k 2000/06/11 c:\cygwin\bin\cygtk80.dll - os=4.0 img=1.0 sys=4.0
                  "cygtk80.dll" v0.0 ts=2000/6/10 23:34
  643k 2000/08/16 c:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2000/8/12 11:21
    Cygwin DLL version info:
        dll major: 1001
        dll minor: 5
        dll epoch: 19
        dll bad signal mask: 19005
        dll old termios: 5
        api major: 0
        api minor: 28
        shared data: 3
        dll identifier: cygwin1
        mount registry: 2
        cygnus registry name: Cygnus Solutions
        cygwin registry name: Cygwin
        program options name: Program Options
        cygwin mount registry name: mounts v2
        build date: Sat Aug 12 11:21:38 EDT 2000
        snapshot date: 2000-08-11-23:55-EST
        shared id: cygwin1S3-2000-08-12 11:21

Use -h to see help about each section

		      *************************

The only substantial differences when I run cygcheck with the other
cygwin1.dll I tested are differences related to the DLL version:

		      *************************

277,278c277,278
<   643k 2000/08/16 c:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
<                   "cygwin1.dll" v0.0 ts=2000/8/12 11:21
---
>   568k 2000/07/27 c:\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
>                   "cygwin1.dll" v0.0 ts=2000/7/27 10:59
281c281
<         dll minor: 5
---
>         dll minor: 3
286c286
<         api minor: 28
---
>         api minor: 24
294,296c294,295
<         build date: Sat Aug 12 11:21:38 EDT 2000
<         snapshot date: 2000-08-11-23:55-EST
<         shared id: cygwin1S3-2000-08-12 11:21
---
>         build date: Thu Jul 27 10:59:35 EDT 2000
>         shared id: cygwin1S3

		      *************************

This is not a problem with Cygwin B20 when using a snapshot of
cygwin1.dll from 1999/9/30:

 4169k 2000/05/02 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1999/9/30 11:42

Any thoughts?

  jik

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]