Bug#453345: debianutils: which script has extraneous code

2007-12-06 Thread Clint Adams
On Wed, Dec 05, 2007 at 02:25:58PM -0500, Adam Katz wrote: > I'd argue for my alternative; nix the case statement and tack on an extra > colon to the end of $PATH when called on line 46, like: > >for ELEMENT in $PATH:; do > > The corner cases where it loops an extra time should be extremely r

Bug#453345: debianutils: which script has extraneous code

2007-12-05 Thread Adam Katz
> For the record, ": foo" is a not entirely uncommon alternative way to > write comments in Bourne shell it's also the only way to squeeze a > comment and a trailing ";;" onto a single line. Wow, I've never seen that outside DOS.bat scripts, but yes, it does that. You can't have a comment followin

Bug#453345: debianutils: which script has extraneous code

2007-12-05 Thread Colin Watson
On Wed, Dec 05, 2007 at 01:49:30PM -0500, Clint Adams wrote: > On Wed, Dec 05, 2007 at 05:45:46PM +, Colin Watson wrote: > > Adam Katz wrote: > > > In the event there IS an empty string in handed to the loop on line 46, > > > nothing will happen unless the argument ("$PROGRAM") happens to exist

Bug#453345: debianutils: which script has extraneous code

2007-12-05 Thread Clint Adams
On Wed, Dec 05, 2007 at 05:45:46PM +, Colin Watson wrote: > > In the event there IS an empty string in handed to the loop on line 46, > > nothing will happen unless the argument ("$PROGRAM") happens to exist as > > a file in / with executable permissions (assuming you remove lines > > 47-49, ot

Bug#453345: debianutils: which script has extraneous code

2007-12-05 Thread Colin Watson
# Regression; see below. reopen 453345 thanks On Wed, Nov 28, 2007 at 05:31:16PM -0500, Adam Katz wrote: > Two bits of extraneous code to remove: > > lines 30-33: > 30 case $PATH in > 31 *::) : "not *DIR:" ;; > 32 *:) PATH="$PATH:" ;; > 33 esac > > Unless this is for some weird nonsta

Bug#453345: debianutils: which script has extraneous code

2007-12-04 Thread Adam Katz
Okay, I did a little more homework on Bourne and found you are right; a trailing colon in the $PATH does indeed put the current directory at the end, and a double-colon in the path does indeed count as the current directory. I knew neither of these things. This mostly retracts my suggestions. >

Bug#453345: debianutils: which script has extraneous code

2007-12-01 Thread Clint Adams
On Wed, Nov 28, 2007 at 05:31:16PM -0500, Adam Katz wrote: > Two bits of extraneous code to remove: > > lines 30-33: > 30 case $PATH in > 31 *::) : "not *DIR:" ;; > 32 *:) PATH="$PATH:" ;; > 33 esac > > Unless this is for some weird nonstandard bourne implementation, the > argument "no

Bug#453345: debianutils: which script has extraneous code

2007-11-28 Thread Adam Katz
Package: debianutils Version: 2.25.1 Severity: minor Two bits of extraneous code to remove: lines 30-33: 30 case $PATH in 31 *::) : "not *DIR:" ;; 32 *:) PATH="$PATH:" ;; 33 esac Unless this is for some weird nonstandard bourne implementation, the argument "not *DIR:" to the colon (: