aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2021-04-07 08:12:06 +0300
committerSergey Poznyakoff <gray@gnu.org>2021-04-07 08:12:06 +0300
commit6ab53876244dab789ec0cbedd87ced3351d37c0a (patch)
tree68d5107070ab991e1c33c4ed1d3f4ae6a50d9cc3
parented0e91f0bd7bcc1bd9d951e8c12a3d41fbb85b52 (diff)
downloadwordsplit-6ab53876244dab789ec0cbedd87ced3351d37c0a.tar.gz
wordsplit-6ab53876244dab789ec0cbedd87ced3351d37c0a.tar.bz2
Fix handling of negative positional arguments
* wordsplit.c (expvar): Fix initial index
-rw-r--r--wordsplit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wordsplit.c b/wordsplit.c
index 0b9cf15..aca63df 100644
--- a/wordsplit.c
+++ b/wordsplit.c
@@ -1442,7 +1442,7 @@ expvar (struct wordsplit *wsp, const char *str, size_t len,
&& (str[1] == '-'
&& ISDIGIT (str[2]))))) != 0))
{
- int i0 = str[0] == '-' ? 1 : 0;
+ int i0 = str[1] == '-' ? 1 : 0;
str++;
len--;
for (i = i0; i < len; i++)

Return to:

Send suggestions and report system problems to the System administrator.