summaryrefslogtreecommitdiff
path: root/Src/Zle/computil.c
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
committerJoe Rayhawk <jrayhawk@fairlystable.org>2025-04-30 02:07:56 -0700
commit26e09889646be3ea65b4a3dfeda26213e4bb6a27 (patch)
tree4f3c73a9416bf47ad7e125383d23cf42879e38d7 /Src/Zle/computil.c
parent841bce705a58b04220b1f257abcc00ae71cbdbdc (diff)
parent001cba48ce3b964cf01fb3e2af54b20eacbc9bf5 (diff)
downloadzsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.tar.gz
zsh-26e09889646be3ea65b4a3dfeda26213e4bb6a27.zip
Merge branch 'upstream' into debian
Diffstat (limited to 'Src/Zle/computil.c')
-rw-r--r--Src/Zle/computil.c19
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;