about summary refs log tree commit diff
path: root/xe.c
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-10-12 16:08:53 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-10-12 16:08:53 +0200
commitfd6b6873a5fac960a8085d75f2c9d4316a1cabb5 (patch)
tree549b55ed5a75e0cb8ed6c100bd3749e8de8fb1a1 /xe.c
parenta35c2e1b9ea4b200d417d694d319c523da2a602a (diff)
downloadxe-fd6b6873a5fac960a8085d75f2c9d4316a1cabb5.tar.gz
xe-fd6b6873a5fac960a8085d75f2c9d4316a1cabb5.tar.xz
xe-fd6b6873a5fac960a8085d75f2c9d4316a1cabb5.zip
perc: plain % should not match empty string
Diffstat (limited to 'xe.c')
-rw-r--r--xe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xe.c b/xe.c
index f5998e8..7e75a57 100644
--- a/xe.c
+++ b/xe.c
@@ -427,7 +427,7 @@ perc(char *pat, char *str, int lvl)
 		return 0;
 	case '%':
 		// any nonempty substring
-		for (l = strlen(str) + 1; l >= 1; l--)
+		for (l = strlen(str); l >= 1; l--)
 			if ((s = perc(pat+1, str+l, lvl))) {
 				perc_str = str;
 				perc_len = l;