about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-08-25 16:55:43 +0000
committerLaurent Bercot <ska@appnovation.com>2021-08-25 16:55:43 +0000
commitfbd69320347e38acd7269393604e31780e4963b3 (patch)
tree42dbb332397b7a1d570a1ff4e8b0d0def97ec4e4
parent9e07e9620cfc56552000e0099b42aa03a7b2222c (diff)
downloadexecline-fbd69320347e38acd7269393604e31780e4963b3.tar.gz
execline-fbd69320347e38acd7269393604e31780e4963b3.tar.xz
execline-fbd69320347e38acd7269393604e31780e4963b3.zip
bugfix: "" usage in multidefine -r
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r--src/libexecline/exlsn_multidefine.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexecline/exlsn_multidefine.c b/src/libexecline/exlsn_multidefine.c
index 9108810..dfb7ab1 100644
--- a/src/libexecline/exlsn_multidefine.c
+++ b/src/libexecline/exlsn_multidefine.c
@@ -65,7 +65,7 @@ int exlsn_multidefine (int argc, char const **argv, char const *const *envp, exl
     }
     if (i < max) pos += strlen(info->values.s + pos) + 1 ;
   }
-  if ((i < max) && likeread) genalloc_s(elsubst_t, &info->data)[i-1].n = max - i + 1 ;
+  if ((i < max) && likeread) genalloc_s(elsubst_t, &info->data)[genalloc_len(elsubst_t, &info->data) - 1].n = max - i + 1 ;
 
   (void)envp ;
   return localopt.ind + argc1 + 2 ;