aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2021-04-16 18:02:11 +0300
committerArnold D. Robbins <arnold@skeeve.com>2021-04-16 18:02:11 +0300
commitde59839144d666b3d8369395159c85ebb40e27fe (patch)
tree329f953420c9f8d7922ceee728b805ba67a3d601
parenta8f16ebdef4e43fcda9a4956e8ef528c33728047 (diff)
downloadegawk-de59839144d666b3d8369395159c85ebb40e27fe.tar.gz
egawk-de59839144d666b3d8369395159c85ebb40e27fe.tar.bz2
egawk-de59839144d666b3d8369395159c85ebb40e27fe.zip
Small bug fix in main.c:arg_assign.
-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;