From 55b03648f1080a4741532e195fadc126d3b81ed9 Mon Sep 17 00:00:00 2001 From: Shea690901 Date: Mon, 1 Feb 2016 15:46:47 +0100 Subject: [PATCH] (m_glob.c): off by one error in translate after checking pat[i] == '[' // from switch it follows with j = i; that pat[j] == '[' --- lib/std/modules/m_glob.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/std/modules/m_glob.c b/lib/std/modules/m_glob.c index a049c7e..46462b2 100644 --- a/lib/std/modules/m_glob.c +++ b/lib/std/modules/m_glob.c @@ -33,17 +33,18 @@ varargs string translate( string pat, int flag ) res += pat[i..i]; continue; } - case '.': + case '.': res += "\\" + pat[i..i]; continue; case '*': res += ".*"; continue; - case '?': + case '?': res += "."; continue; case '[': - j=i; + // j=i; <= pat[i] == pat[j] == '[' + j = i + 1 if( j