pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/51142: pdksh has occasional issues with empty 'for' loops



The following reply was made to PR pkg/51142; it has been noted by GNATS.

From: Richard PALO <richard%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/51142: pdksh has occasional issues with empty 'for' loops
Date: Tue, 31 May 2016 17:49:06 +0200

 Le 19/05/16 13:45, Richard PALO a écrit :
 > 
 >  I'm concerned about the extent of the fix wherein the code is working on *both* 'for' and 'select'.
 >  
 
 Adding as well the following patch seems to get 'select' to a similarly working situation:
 > diff --git a/shells/pdksh/files/exec.c b/shells/pdksh/files/exec.c
 > index 734d484..14e216b 100644
 > --- a/shells/pdksh/files/exec.c
 > +++ b/shells/pdksh/files/exec.c
 > @@ -334,7 +334,7 @@ execute(t, flags)
 >                 }
 >  #ifdef KSH
 >                 else { /* TSELECT */
 > -                       for (;;) {
 > +                       while (*ap != NULL) {
 >                                 if (!(cp = do_selectargs(ap, is_first))) {
 >                                         rv = 1;
 >                                         break;
 
 
 before:
 > richard@omnis:/home/richard/src/pkgsrc/shells/pdksh$ /opt/local/bin/pdksh.orig 
 > $ set dummy
 > $ select i in ; do echo $i; break; done
 > 1) dummy
 > #? 1
 > dummy
 > $ select i ; do echo $i; break; done
 > 1) dummy
 > #? 1
 > dummy
 
 
 after:
 > richard@omnis:/home/richard/src/pkgsrc/shells/pdksh$  /tmp/pkgsrc/shells/pdksh/work/.destdir/opt/local/bin/pdksh 
 > $ set dummy
 > $  select i in ; do echo $i; break; done
 > $ echo $?
 > 0
 > $ select i ; do echo $i; break; done
 > 1) dummy
 > #? 1
 > dummy
 > $ echo $?
 > 0
 
 
 Request some 'okays' to commit
 -- 
 Richard PALO
 


Home | Main Index | Thread Index | Old Index