aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--main.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 64dba79d..beb3bdef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2021-04-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * main (arg_assign): For -v '@/...' make sure that there are
+ at least three characters there. Thanks to Ed Morton
+ <mortoneccc@comcast.net> for the report.
+
2021-04-14 Arnold D. Robbins <arnold@skeeve.com>
Fix up lint warnings for "no effect" to avoid false warnings.
diff --git a/main.c b/main.c
index 5b153bc3..19c50b6d 100644
--- a/main.c
+++ b/main.c
@@ -1203,6 +1203,7 @@ arg_assign(char *arg, bool initing)
cp2 = cp + strlen(cp) - 1; // end char
if (! do_traditional
+ && strlen(cp) >= 3 // '@/' doesn't do it.
&& cp[0] == '@' && cp[1] == '/' && *cp2 == '/') {
// typed regex
size_t len = strlen(cp) - 3;