darcs patch: Pass additional parameters in generated shell scripts

1 patch for repository http://darcs.volkswurst.de/packages/Cabal:
Sun May 16 18:12:30 CEST 2010 Matthias Kilian

On Sun, May 16, 2010 at 08:17:26PM +0200, Matthias Kilian wrote:
- ++ quote path ++ concatMap (\arg -> ' ':quote arg) args ] + ++ unwords (map quote $ path : args) ++ " \"$@\""]
This looks liks it ought to be " ${1+\"$@\"}" rather than " \"$@\"", to correctly handle the case where there are no additional parameters. Thanks Ian

On Sun, May 16, 2010 at 08:30:25PM +0100, Ian Lynagh wrote:
On Sun, May 16, 2010 at 08:17:26PM +0200, Matthias Kilian wrote:
- ++ quote path ++ concatMap (\arg -> ' ':quote arg) args ] + ++ unwords (map quote $ path : args) ++ " \"$@\""]
This looks liks it ought to be " ${1+\"$@\"}" rather than " \"$@\"", to correctly handle the case where there are no additional parameters.
"$@" is supposed to also work in that case.

On Sun, May 16, 2010 at 09:10:32PM +0100, Ross Paterson wrote:
On Sun, May 16, 2010 at 08:30:25PM +0100, Ian Lynagh wrote:
On Sun, May 16, 2010 at 08:17:26PM +0200, Matthias Kilian wrote:
- ++ quote path ++ concatMap (\arg -> ' ':quote arg) args ] + ++ unwords (map quote $ path : args) ++ " \"$@\""]
This looks liks it ought to be " ${1+\"$@\"}" rather than " \"$@\"", to correctly handle the case where there are no additional parameters.
"$@" is supposed to also work in that case.
Ian may be right; IIRC there were some discussions on the darcs mailinglists about "$@" which, although conforming to posix, may break some older shells (probably solaris? does anyone remember?). Ciao, Kili
participants (3)
-
Ian Lynagh
-
Matthias Kilian
-
Ross Paterson