Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] set null IFS in v* commands
@ 2023-03-18 22:30 gandalf3
  2023-03-18 22:54 ` paper42
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gandalf3 @ 2023-03-18 22:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]

There is a new pull request by gandalf3 against master on the void-packages repository

https://github.com/gandalf3/void-packages master
https://github.com/void-linux/void-packages/pull/42850

set null IFS in v* commands
without this, if `<pattern>` arguments contain whitespace, word splitting causes the argument to be split unexpectedly.

for example:
    `vcopy 'Spacey Folder/*.ttf' usr/share/TTF/`

calls something equivalent to
    `cp "Spacey" "Folder/*.ttf" usr/share/TTF/`

which of course fails.

i couldn't find a way to escape word splitting from outside, aside from setting `IFS`.
i'm not at all confident this won't break anything else in install.sh, but if it doesn't, i think it would be nice to preserve the expectation that `<pattern>` arguments are just pure globs.

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly**

A patch file from https://github.com/void-linux/void-packages/pull/42850.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-42850.patch --]
[-- Type: text/x-diff, Size: 952 bytes --]

From 5ba6bdefef67bdcc87e3badd67b3502b5c66f1cb Mon Sep 17 00:00:00 2001
From: gandalf3 <gandalf3@blendermonkey.com>
Date: Sat, 18 Mar 2023 15:07:28 -0700
Subject: [PATCH] set null IFS in v* commands

without this, if <pattern> arguments contain whitespace, word splitting
causes the pattern argument to be split unexpectedly.

for example:
    vcopy 'Spacey Folder/*.ttf' usr/share/TTF/

calls something equivilent to
    cp "Spacey" "Folder/*.ttf" usr/share/TTF/

which of course fails.
---
 common/environment/setup/install.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/environment/setup/install.sh b/common/environment/setup/install.sh
index b0c5b22f4c2a..0bf3a1417a37 100644
--- a/common/environment/setup/install.sh
+++ b/common/environment/setup/install.sh
@@ -9,7 +9,7 @@ unalias -a
 # disable wildcards helper
 _noglob_helper() {
        set +f
-       "$@"
+       IFS= "$@"
 }
 
 # Apply _noglob to v* commands

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-12  2:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18 22:30 [PR PATCH] set null IFS in v* commands gandalf3
2023-03-18 22:54 ` paper42
2023-03-20  4:42 ` classabbyamp
2023-03-28 15:21 ` Chocimier
2023-03-28 15:25 ` classabbyamp
2023-03-28 19:25 ` Chocimier
2023-06-27  2:08 ` github-actions
2023-07-12  2:06 ` [PR PATCH] [Closed]: " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).