ksh/ksh93-whence-deadlock.dif
2010-05-03 12:52:43 +00:00

35 lines
1.0 KiB
Plaintext

|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:
|
--- src/cmd/ksh93/bltins/whence.c
+++ 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
|ast-developers@research.att.com
|https://mailman.research.att.com/mailman/listinfo/ast-developers