From 7d8c22ecef3f936363a039d2949c62a77aee30c4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sat, 13 Jan 2007 10:59:07 +0000 Subject: [PATCH] * Fixed -c behaviour. Sometimes apps open "$PWD/file" when asked to simply open "file" (eg. eog). --- src/zzuf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/zzuf.c b/src/zzuf.c index 3f132be..5c50e9c 100644 --- a/src/zzuf.c +++ b/src/zzuf.c @@ -379,9 +379,13 @@ static void loop_stdin(void) static char *merge_file(char *regex, char *file) { - char *newfile = malloc(1 + 2 * strlen(file) + 1 + 1), *tmp = newfile; + char *newfile = malloc(5 + 2 * strlen(file) + 1 + 1), *tmp = newfile; + *tmp++ = '('; *tmp++ = '^'; + *tmp++ = '|'; + *tmp++ = '/'; + *tmp++ = ')'; while(*file) { if(strchr("^.[$()|*+?{\\", *file))