Fix #474 - Segfault in pc+backticks

This commit is contained in:
pancake 2013-12-22 00:45:50 +01:00
parent 9c1f5e73e1
commit f29cbb5ad6

View File

@ -1137,12 +1137,17 @@ next2:
/* sub commands */
ptr = strchr (cmd, '`');
if (ptr) {
int empty = 0;
int oneline = 1;
if (ptr[1]=='`') {
memmove (ptr, ptr+1, strlen (ptr));
oneline = 0;
empty = 1;
}
ptr2 = strchr (ptr+1, '`');
if (empty) {
/* do nothing */
} else
if (!ptr2) {
eprintf ("parse: Missing backtick in expression.\n");
return -1;