Hi,
I've got another bug report from one Fedora user. When whence builtin is used
with -q option it hangs. Whence was modified a lot between 2008-02-02 and
2008-07-25. New version uses while(pp) loop but for Q_FLAG pp never changes
causing ksh loop forever. I've just added pp = 0 to Q_FLAG if-section and it
seems working fine:
diff -up ksh-20100309/src/cmd/ksh93/bltins/whence.c.fixwh
ksh-20100309/src/cmd/ksh93/bltins/whence.c
--- ksh-20100309/src/cmd/ksh93/bltins/whence.c.fixwh 2008-09-19
16:13:40.000000000 +0200
+++ ksh-20100309/src/cmd/ksh93/bltins/whence.c 2010-04-29 12:03:22.744013139
+0200
@@ -234,7 +234,10 @@ static int whence(Shell_t *shp,char **ar
}
}
if(flags&Q_FLAG)
+ {
r |= !cp;
+ pp = 0;
+ }
else if(cp)
{
if(flags&V_FLAG)
Btw, when looking in the code it seems tofree variable is never checked when
Q_FLAG is used and also in the loop this value is sometimes set to 1, but
never zeroed once it is set, is it expected?
Regards,
Michal Hlavinka
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers