summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a396536)
raw | patch | inline | side by side (parent: a396536)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 29 May 2007 13:34:10 +0000 (15:34 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 29 May 2007 13:34:10 +0000 (15:34 +0200) |
Shell quote the path always.
tig.c | patch | blob | history |
index 7cf25ca4507a26d7c493278e15e2bfc2f71e126f..5e75b5acd83a6cb1c3c3c2a00c31c6428962cd76 100644 (file)
--- a/tig.c
+++ b/tig.c
}
BUFPUT('\'');
+ if (bufsize < SIZEOF_STR)
+ buf[bufsize] = 0;
+
return bufsize;
}
} else if (view == VIEW(REQ_VIEW_TREE)) {
const char *format = view->cmd_env ? view->cmd_env : view->cmd_fmt;
+ char path[SIZEOF_STR];
if (strcmp(view->vid, view->id))
- opt_path[0] = 0;
+ opt_path[0] = path[0] = 0;
+ else if (sq_quote(path, 0, opt_path) >= sizeof(path))
+ return FALSE;
- if (!string_format(view->cmd, format, id, opt_path))
+ if (!string_format(view->cmd, format, id, path))
return FALSE;
} else {