|
@@ -476,14 +476,20 @@ static struct command_descriptor isset_cmd =
|
476
|
476
|
*/
|
477
|
477
|
static int isset_exec ( int argc, char **argv ) {
|
478
|
478
|
struct isset_options opts;
|
|
479
|
+ int i;
|
479
|
480
|
int rc;
|
480
|
481
|
|
481
|
482
|
/* Parse options */
|
482
|
483
|
if ( ( rc = parse_options ( argc, argv, &isset_cmd, &opts ) ) != 0 )
|
483
|
484
|
return rc;
|
484
|
485
|
|
485
|
|
- /* Return success iff any arguments exist */
|
486
|
|
- return ( ( optind == argc ) ? -ENOENT : 0 );
|
|
486
|
+ /* Return success if any argument is non-empty */
|
|
487
|
+ for ( i = optind ; i < argc ; i++ ) {
|
|
488
|
+ if ( argv[i][0] != '\0' )
|
|
489
|
+ return 0;
|
|
490
|
+ }
|
|
491
|
+
|
|
492
|
+ return -ENOENT;
|
487
|
493
|
}
|
488
|
494
|
|
489
|
495
|
/** "isset" command */
|