fs/cpio/init: preserve arguments
PATCH 1/1 fs/cpio/init: preserve arguments
Use "$@" instead of $* to preserve argument.
--- fs/cpio/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cpio/init +1 -1
@@ -4,4 +4,4 @@ exec 0</dev/console exec 1>/dev/console exec 2>/dev/console -exec /sbin/init $* +exec /sbin/init "$@"
Signature · 1 line
2.16.1
PATCH 1/1 fs/cpio/init: preserve arguments
Hello,
Quoted 1 line · Ga?l PORTAY
Use "$@" instead of $* to preserve argument.
Thanks for your patch, but why ? The commit log needs to explain the use-case/motivations/reasons.
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
PATCH 1/1 fs/cpio/init: preserve arguments
Quoted 7 lines · Thomas Petazzoni
Hello,
Quoted 1 line · Ga?l PORTAY
Use "$@" instead of $* to preserve argument.
Thanks for your patch, but why ? The commit log needs to explain the use-case/motivations/reasons.
Using $* here will split each of the arguments at the spaces (well, at any of the characters fro $IFS): that means that passing 'has space' as argument, using $* will result in two arguments 'has' and 'space' being passed down. Using "$@" prevents $IFS-splitting and passes argument unchanged as-is.
In most cases whenever there is a $* in a shell script, pretty much it means that passing the parameters with spaces (file names, paths, etc.) will break things.
Cheers,
--
Adri?n ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180221/3604ce5f/attachment.asc>
PATCH 1/1 fs/cpio/init: preserve arguments
In reply to Thomas PetazzoniThomas,
Quoted 7 lines · Thomas Petazzoni
Hello,
Quoted 1 line · Ga?l PORTAY
Use "$@" instead of $* to preserve argument.
Thanks for your patch, but why ? The commit log needs to explain the use-case/motivations/reasons.
Sorry for this lack of information.
I will send a v2 with an appropriate commit message.
Quoted 8 lines
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com
Regards,
Gael
PATCH 1/1 fs/cpio/init: preserve arguments
In reply to Gaël PORTAYQuoted 3 lines · Ga?l PORTAY
Use "$@" instead of $* to preserve argument.
Signed-off-by Ga?l PORTAY <[email protected]>
Quoted 21 lines
--- fs/cpio/init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/cpio/init +1
-1@@ -4,4 +4,4 @@ exec 0</dev/console exec 1>/dev/console exec 2>/dev/console -exec /sbin/init $* +exec /sbin/init "$@"Signature · 6 lines
2.16.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180221/538c786a/attachment.asc>
PATCH 1/1 fs/cpio/init: preserve arguments
In reply to Gaël PORTAYQuoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Ga?l" == Ga?l PORTAY <[email protected]> writes:
Use "$@" instead of $* to preserve argument.
Signed-off-by Ga?l PORTAY <[email protected]>
Committed after extending the commit message, thanks.
Signature · 1 line
Bye, Peter Korsgaard