[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: /bin/sh: invalid option -- 1
From:       "Piotr Grudzinski" <piotr () powersmiths ! com>
Date:       2009-08-20 14:53:28
Message-ID: BC6AAB895AAE4F2290FCE3D19002D335 () Piotr
[Download RAW message or body]

It woks fine now. Thanks!
--
Piotr

----- Original Message ----- 
> > > Running bb v1.15.0.svn (2009-08-14) and hush.
>                                            ^^^^^^
> > >
> > > The runsv applet (part of runit utility) calls
> > my finish script with an> argument set to "-1". busybox seems to
> > assume that this is an option and> displays:
> > >
> > > /bin/sh: invalid option -- 1
> > >
> > > The same happens if I call the script with an
> > > argument containing leading> '-' . Example: ./finish -abc
> > >
> > > Is this a bug?
> > 
> > What is your /bin/sh? (bash/ash/hush/...)
> > 
> 
> hush it is (as I said - not very precisely - above).

Ahhh stupid bug. Please find the fix below.
-- 
vda

diff -d -urpN busybox.4/shell/hush.c busybox.5/shell/hush.c
--- busybox.4/shell/hush.c 2009-08-17 02:11:09.000000000 +0200
+++ busybox.5/shell/hush.c 2009-08-20 03:29:56.000000000 +0200
@@ -6461,7 +6461,7 @@ int hush_main(int argc, char **argv)
  /* http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html */
  builtin_argc = 0;
  while (1) {
- opt = getopt(argc, argv, "c:xins"
+ opt = getopt(argc, argv, "+c:xins"
 #if !BB_MMU
  "<:$:R:V:"
 # if ENABLE_HUSH_FUNCTIONS
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic