From: Gerald Carter Date: Tue, 16 Mar 2004 19:44:40 +0000 (+0000) Subject: BUG 748 - patch from jpeach@sgi.com (James Peach); relax arg parsing to sambalp script X-Git-Tag: samba-4.0.0alpha6~801^2~11814 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=107ddbdc6ed0632e54eeb597f6fafe82f4662a1a;p=thirdparty%2Fsamba.git BUG 748 - patch from jpeach@sgi.com (James Peach); relax arg parsing to sambalp script (This used to be commit e2361da91f58e123c900f989b0afe94e93387a5d) --- diff --git a/packaging/SGI/sambalp b/packaging/SGI/sambalp index 61e62215c91..27ca5165f97 100644 --- a/packaging/SGI/sambalp +++ b/packaging/SGI/sambalp @@ -50,8 +50,9 @@ $PSFIX = 1; # set to 0 if you don't want to run EOF $ENV{'PATH'} = join(':',@PATH); -if ($#ARGV < 3) { - print STDERR "usage: $PROG printer file user system\n"; + print "$#ARGV ".scalar(@ARGV)."\n"; +if (scalar(@ARGV) < 2) { + print STDERR "usage: $PROG printer file [user] [system]\n"; exit; } @@ -60,6 +61,9 @@ $file = $ARGV[1]; $user = $ARGV[2]; $system = $ARGV[3]; +$user = "nobody" unless($user); +$system = `hostname` unless($system); + open(LPSTAT,"/usr/bin/lpstat -t|") || die("Can't get printer list.\n"); @printers = (); while () {