snapcraft-desktop-helpers icon indicating copy to clipboard operation
snapcraft-desktop-helpers copied to clipboard

Fixup parameter expansions

Open brlin-tw opened this issue 6 years ago • 4 comments

It is possible that one's home directory path contains spaces, this patch fixes most affected expansions by wrapping them with double quotes.

This PR also includes a patch to apply quoting to all parameter expansions, to help avoid alike failures in the future.

Signed-off-by: 林博仁(Buo-ren Lin) [email protected]

brlin-tw avatar May 19 '18 06:05 brlin-tw

This is functionally equivalent, but wouldn't it be more readable to have:

append_dir LD_LIBRARY_PATH "$RUNTIME/lib/$ARCH"

instead of:

append_dir LD_LIBRARY_PATH "$RUNTIME"/lib/"$ARCH"

oSoMoN avatar May 29 '18 15:05 oSoMoN

In fact, I do previously preferred the 1st style but changed my mind during generating these patches due to the search&replace friendliness and well, they are indeed functionally equivalent.

I'll switch the style soon if people felt comfortable about it.

brlin-tw avatar May 29 '18 16:05 brlin-tw

That's not a requirement from my end, rather a mere suggestion. I'm curious what others think about it.

oSoMoN avatar May 29 '18 16:05 oSoMoN

Another argument is that word splitting simply doesn't happen at the external portions of the quoting, quoting them might give viewers a false impression of the quoting in bash scripting in general and abusing it unnecessarily.

But again this argument did appear during the generation of these patches, so comments are welcome.

brlin-tw avatar May 29 '18 16:05 brlin-tw