develooper Front page | perl.perl5.porters | Postings from June 2010

[perl #75530] Buggy parsing of script arguments in windows

Thread Next
From:
AlexandrFedorov
Date:
June 3, 2010 02:07
Subject:
[perl #75530] Buggy parsing of script arguments in windows
Message ID:
rt-3.6.HEAD-4976-1275544257-974.75530-75-0@perl.org
# New Ticket Created by  AlexandrFedorov 
# Please include the string:  [perl #75530]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=75530 >


This is a bug report for perl from alexandrfedorov@gmail.com,
generated with the help of perlbug 1.39 running under perl 5.12.0.


-----------------------------------------------------------------
[Please describe your issue here]


There is a problem with parsing command line arguments in Perl in windows:

for example this command in cmd.exe:

perl -E "say join qq(\n),@ARGV" "123 234\" 123

resulting:

123 234" 123

but it must be:

123 234\
123

Why it's important? Because filepath separator in windows is "\" and i can't
use long filepaths or UNC in arguments of scripts (for example "
\\server\share\some <file://server/share/some> folder\")

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.12.0:

Configured by 1 at Wed Apr 28 20:49:19 2010.

Summary of my perl5 (revision 5 version 12 subversion 0) configuration:

  Platform:
    osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
    uname='Win32 strawberryperl 5.12.0.0 #1 Wed Apr 28 11:51:06 2010 i386'
    config_args='undef'
    hint=recommended, useposix=true, d_sigaction=undef
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=undef, use64bitall=undef, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT
-DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-fno-strict-aliasing -mms-bitfields -DPERL_MSVCRT_READFIX',
    optimize='-s -O2',
    cppflags='-DWIN32'
    ccversion='', gccversion='4.4.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long',
lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='g++', ldflags ='-s -L"C:\strawberry\perl\lib\CORE"
-L"C:\strawberry\c\lib"'
    libpth=C:\strawberry\c\lib C:\strawberry\c\i686-w64-mingw32\lib
    libs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
-lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs=-lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
-lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=, so=dll, useshrplib=true, libperl=libperl511.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags='-mdll -s -L"C:\strawberry\perl\lib\CORE"
-L"C:\strawberry\c\lib"'

Locally applied patches:


---
@INC for perl 5.12.0:
    C:/strawberry/perl/site/lib
    C:/strawberry/perl/vendor/lib
    C:/strawberry/perl/lib
    .

---
Environment for perl 5.12.0:
    HOME (unset)
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\strawberry\c\bin;C:\strawberry\perl\bin;C:\Program
Files\Git\cmd;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\strawberry\perl\site\bin;Z:\Software\Tools\Sysinternals\pstools;I:\programz\utils
    PERL_BADLANG (unset)
    SHELL (unset)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About