summaryrefslogtreecommitdiff
path: root/lib/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parser.c')
-rw-r--r--lib/parser.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/parser.c b/lib/parser.c
index 858061397fe2..790ec2a858d7 100644
--- a/lib/parser.c
+++ b/lib/parser.c
@@ -45,7 +45,9 @@ static int match_one(char *s, char *p, substring_t args[])
args[argc].from = s;
switch (*p++) {
case 's':
- if (len == -1 || len > strlen(s))
+ if (strlen(s) == 0)
+ return 0;
+ else if (len == -1 || len > strlen(s))
len = strlen(s);
args[argc].to = s + len;
break;