1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-10 12:40:58 +02:00

more careful with checking index of $history (10614)

This commit is contained in:
Sven Wischnowsky 2000-04-10 08:22:09 +00:00
parent 0713dfcd1a
commit 724b065397
2 changed files with 16 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2000-04-10 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
* 10614: Src/Modules/parameter.c: more careful with checking index
of $history
* 10609: Src/Zle/compcore.c, Src/Zle/compresult.c, Src/Zle/zle_tricky.c:
fix for bashautolist+automenu

View file

@ -1020,6 +1020,8 @@ getpmhistory(HashTable ht, char *name)
{
Param pm = NULL;
Histent he;
char *p;
int ok = 1;
pm = (Param) zhalloc(sizeof(struct param));
pm->nam = dupstring(name);
@ -1032,7 +1034,17 @@ getpmhistory(HashTable ht, char *name)
pm->ename = NULL;
pm->old = NULL;
pm->level = 0;
if ((he = quietgethist(atoi(name))))
if (*name != '0' || name[1]) {
if (*name == '0')
ok = 0;
else {
for (p = name; *p && idigit(*p); p++);
if (*p)
ok = 0;
}
}
if (ok && (he = quietgethist(atoi(name))))
pm->u.str = dupstring(he->text);
else {
pm->u.str = dupstring("");