From 80fd71d240b39cd2f31b42278ed3616cd0dbb3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Sawicz?= Date: Tue, 13 Nov 2012 18:32:03 +0000 Subject: [PATCH] Allow ~ through unescaped freedesktop #57078 --- check/Makefile.am | 6 ++++-- check/check-tilde | 13 +++++++++++++ check/tilde.pc | 5 +++++ parse.c | 3 ++- 4 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 check/check-tilde create mode 100644 check/tilde.pc diff --git a/check/Makefile.am b/check/Makefile.am index 8b8485f..46e66a2 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -22,7 +22,8 @@ TESTS = \ check-path \ check-sysroot \ check-uninstalled \ - check-debug + check-debug \ + check-tilde EXTRA_DIST = \ $(TESTS) \ @@ -51,4 +52,5 @@ EXTRA_DIST = \ circular-1.pc \ circular-2.pc \ circular-3.pc \ - no-variables.pc + no-variables.pc \ + tilde.pc diff --git a/check/check-tilde b/check/check-tilde new file mode 100644 index 0000000..0ffc8f5 --- /dev/null +++ b/check/check-tilde @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +. ${srcdir}/common + +# expect unescaped tilde from cflags +RESULT='-I~' +run_test --cflags tilde + +# expect unescaped tilde from libs +RESULT='-L~' +run_test --libs tilde diff --git a/check/tilde.pc b/check/tilde.pc new file mode 100644 index 0000000..8af1798 --- /dev/null +++ b/check/tilde.pc @@ -0,0 +1,5 @@ +Name: test +Description: test module +Version: 1.0 +Libs: -L~ +Cflags: -I~ diff --git a/parse.c b/parse.c index 671ad71..4d5463f 100644 --- a/parse.c +++ b/parse.c @@ -583,7 +583,8 @@ static char *strdup_escape_shell(const char *s) (s[0] > '=' && s[0] < '@') || (s[0] > 'Z' && s[0] < '^') || (s[0] == '`') || - (s[0] > 'z')) { + (s[0] > 'z' && s[0] < '~') || + (s[0] > '~')) { r[c] = '\\'; c++; } -- 1.7.10.4