[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

[ID 20000125.005]



~s Getopt::Std does not heed --
This is a bug report for perl from Marc.Espie@liafa.jussieu.fr,
generated with the help of perlbug 1.26 running under perl 5.00503.


-----------------------------------------------------------------
[Please enter your report here]

Getopt::Std   does not stop processing options when it encounters 
`--', as is traditional under Unix. 
Since there is no escape mechanism, this makes Getopt::Std useless
for real programs.

The following patch makes it recognize --.

--- Std.pm.orig	Tue Jan 25 22:08:42 2000
+++ Std.pm	Tue Jan 25 22:15:12 2000
@@ -60,6 +60,10 @@ sub getopt ($;$) {
 
     while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
 	($first,$rest) = ($1,$2);
+	if (/^--$/) { 	# early exit if --
+		shift(@ARGV);
+		last;
+	}
 	if (index($argumentative,$first) >= 0) {
 	    if ($rest ne '') {
 		shift(@ARGV);
@@ -111,6 +115,10 @@ sub getopts ($;$) {
     @args = split( / */, $argumentative );
     while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
 	($first,$rest) = ($1,$2);
+	if (/^--$/) { 	# early exit if --
+		shift(@ARGV);
+		last;
+	}
 	$pos = index($argumentative,$first);
 	if($pos >= 0) {
 	    if(defined($args[$pos+1]) and ($args[$pos+1] eq ':')) {


[Please do not change anything below this line]
-----------------------------------------------------------------

---
Site configuration information for perl 5.00503:

Configured by root at Fri Oct 22 00:01:19 MDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=openbsd, osvers=2.6, archname=i386-openbsd
    uname='openbsd'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.95.1 19990816 (release)
    cppflags=''
    ccflags =''
    stdchar='char', d_stdstdio=undef, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =''
    libpth=/usr/lib
    libs=-lm -lc
    libc=/usr/lib/libc.a, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=define, ccdlflags=' '
    cccdlflags='-DPIC -fPIC ', lddlflags='-Bforcearchive -Bshareable '

Locally applied patches:
    

---
@INC for perl 5.00503:
    /usr/libdata/perl5/i386-openbsd/5.00503
    /usr/local/libdata/perl5/i386-openbsd/5.00503
    /usr/libdata/perl5
    /usr/local/libdata/perl5
    /usr/local/libdata/perl5/site_perl/i386-openbsd
    /usr/libdata/perl5/site_perl/i386-openbsd
    /usr/local/libdata/perl5/site_perl
    /usr/libdata/perl5/site_perl
    .

---
Environment for perl 5.00503:
    HOME=/home/espie
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/espie/bin:/usr/local/egcs/bin:/usr/games:/usr/local/bin:/usr/local/maple/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/sbin:/emul/linux/usr/local/bin:/emul/linux/usr/bin:/emul/linux/usr/X11R6/bin:/emul/linux/bin
    PERL_BADLANG (unset)
    SHELL=/bin/zsh


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]