Github messages for voidlinux
 help / color / mirror / Atom feed
From: gandalf3 <gandalf3@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] set null IFS in v* commands
Date: Sat, 18 Mar 2023 23:30:26 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42850@inbox.vuxu.org> (raw)

[-- 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

             reply	other threads:[~2023-03-18 22:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18 22:30 gandalf3 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42850@inbox.vuxu.org \
    --to=gandalf3@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).