-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] Makefile.SH: Fix quote() function to escape backslashes but not minus signs #14659
Comments
From @ntyniThe intent of the scary regexp in quote() of Makefile.SH seems to be to However, a sed peculiarity seems to be that neither the backslash ('\') The backslash case is appropriately documented in the GNU sed manual, The attached proposed patch changes the list of allowed characters to Builds in a directory with a backslash in its name still don't work, Thanks for your work on Perl, |
From @ntyni0001-Fix-quote-function-to-escape-backslashes-but-not-min.patchFrom 361cd793dff23c00917ea82dbdd9b6d46d1d77d9 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Sat, 18 Apr 2015 18:59:07 +0300
Subject: [PATCH] Fix quote() function to escape backslashes but not minus
signs
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The delimiter character isn't special in character square brackets,
and neither is the backslash. So '\-\' means just a range of backslash
to backslash, and the minus sign isn't included at all.
Substitution tested with GNU Solaris 9 sed programs.
Originally noticed by Kristoffer Grundström.
Bug-Debian: https://bugs.debian.org/754057
---
Makefile.SH | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.SH b/Makefile.SH
index eb082c2..82fbc80 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -5,7 +5,7 @@
quote() {
case "$1" in
'') echo "''" ;;
- *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g' ;;
+ *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_/-]\)/\\\1/g' ;;
esac
}
--
2.1.4
|
From @tonycozOn Sat Apr 18 11:38:57 2015, ntyni@debian.org wrote:
I also tested this on NetBSD and HP-UX. According to: http://pubs.opengroup.org/onlinepubs/009695399/utilities/sed.html#tag_04_126_13_02 the s/// BRE treats escaped delimiters as a literal delimiter, and doesn't mention any special behaviour in brackets. But it behaves are you described (HP-UX): bash-4.3$ echo 'foo bar/\' | sed 's/\([^a-zA-Z0-9.:_/-]\)/\\\1/g' I've added this to my post-5.22 branch. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Sat Apr 18 11:38:57 2015, ntyni@debian.org wrote:
Thanks, applied as 87d9837. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
@tonycoz - Status changed from 'resolved' to 'pending release' |
From @khwilliamsonThank you for submitting this report. You have helped make Perl better. Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0 |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#124343 (status was 'resolved')
Searchable as RT124343$
The text was updated successfully, but these errors were encountered: