diff options
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r-- | Src/Zle/computil.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 59abb4cc4..6ac458c91 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -911,7 +911,7 @@ struct cadef { Caarg rest; /* the rest-argument */ char **defs; /* the original strings */ int ndefs; /* number of ... */ - int lastt; /* last time this was used */ + time_t lastt; /* last time this was used */ Caopt *single; /* array of single-letter options */ char *match; /* -M spec to use */ int argsactive; /* if normal arguments are still allowed */ @@ -1296,8 +1296,7 @@ parse_cadef(char *nam, char **args) int l = strlen(p) - 1; if (*p == '(' && p[l] == ')') { - axor = p = dupstring(p + 1); - p[l - 1] = '\0'; + axor = p = dupstring_wlen(p + 1, l - 1); } else axor = NULL; if (!*p) { @@ -1317,8 +1316,7 @@ parse_cadef(char *nam, char **args) p = *++args; l = strlen(p) - 1; if (*p == '(' && p[l] == ')') { - axor = p = dupstring(p + 1); - p[l - 1] = '\0'; + axor = p = dupstring_wlen(p + 1, l - 1); } else axor = NULL; if (!*p) { @@ -1339,7 +1337,7 @@ parse_cadef(char *nam, char **args) LinkList list = newlinklist(); LinkNode node; - char **xp, sav; + char **xp; while (*p && *p != ')') { for (p++; inblank(*p); p++); @@ -1351,11 +1349,8 @@ parse_cadef(char *nam, char **args) if (!*p) break; - sav = *p; - *p = '\0'; - addlinknode(list, dupstring(q)); + addlinknode(list, dupstring_wlen(q, p - q)); xnum++; - *p = sav; } /* Oops, end-of-string. */ if (*p != ')') { @@ -2935,7 +2930,7 @@ struct cvdef { Cvval vals; /* value definitions */ char **defs; /* original strings */ int ndefs; /* number of ... */ - int lastt; /* last time used */ + time_t lastt; /* last time used */ int words; /* if to look at other words */ }; @@ -4383,7 +4378,7 @@ cfp_matcher_range(Cmatcher *ms, char *add) * word pattern. */ if ((ind = pattern_match_equivalence - (m->word, ind, mt, addc)) != CHR_INVALID) { + (m->word, ind+1, mt, addc)) != CHR_INVALID) { if (ret) { if (imeta(ind)) { *p++ = Meta; |