summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--quilt.changes5
-rw-r--r--quilt/grep.in4
-rw-r--r--test/space-in-filenames.test7
3 files changed, 14 insertions, 2 deletions
diff --git a/quilt.changes b/quilt.changes
index f160fd0..11dccd6 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Feb 1 21:00:45 CET 2012 - jdelvare@suse.de
+
+- grep: Accept file names with spaces.
+
+-------------------------------------------------------------------
Wed Feb 1 20:15:01 CET 2012 - jdelvare@suse.de
- Makefile.in: Include utilfns when generating source tarball.
diff --git a/quilt/grep.in b/quilt/grep.in
index 270ba9c..0c32fcf 100644
--- a/quilt/grep.in
+++ b/quilt/grep.in
@@ -117,8 +117,8 @@ fi
find "${myargs[@]:-.}" \( \
-path "./$QUILT_PATCHES/*" -o \
-path "./$QUILT_PC/*" \) -prune -o \
- -type f -print \
-| xargs grep $opt_H "${args[@]}" \
+ -type f -print0 \
+| xargs -0 grep $opt_H "${args[@]}" \
| if [ ${#myargs[@]} -eq 0 ]; then
sed -e 's,^./,,'
else
diff --git a/test/space-in-filenames.test b/test/space-in-filenames.test
index eb0d035..fa0ddf8 100644
--- a/test/space-in-filenames.test
+++ b/test/space-in-filenames.test
@@ -77,6 +77,13 @@ $ cat patches/test.diff
> -foo
> +bar
+$ quilt grep bar
+> foo bar:bar
+$ quilt grep new
+> a: b [c]:new line
+$ quilt grep " "
+> a: b [c]:new line
+
$quilt remove "a: b [c]"
> File a: b [c] removed from patch patches/test.diff