job000019 | if ( "" a b ) returns false; was true in 2.3 | From: Vladimir Prus <ghost@...cs.msu.su> | To: jamming@perforce.com, jamboost@yahoogroups.com | Date: Fri, 22 Mar 2002 12:58:50 +0300 | Subject: [jamming] "if" behaviour change from 2.3 to 2.4 | | | Hi, | the following code: | | l = "" a b ; | | if $(l) { | ECHO "Okay" ; | } | | Behaves differently in 2.3 and the most most recent version from the public | depot. Should this be considered a bug? | | The problem is in compile.c: | LIST * | compile_eval( | PARSE *parse, | LOL *args ) | { | ........................... | switch( parse->num ) | { | case EXPR_EXISTS: | if( ll && ll->string[0] ) status = 1; | ^^^^^^^^ here's the problem | should check all the elements of the list. | It appears to be trivial to fix. | | - Volodya | « | |
Add Job |