return 0 rather than "" when scalar grep has nothing to iterate
Gurusamy Sarathy [Mon, 24 May 1999 05:05:19 +0000 (05:05 +0000)]
on (brings behavior in line with documentation)

p4raw-id: //depot/perl@3455

pp_ctl.c

index 49db741..19bfb21 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -667,7 +667,7 @@ PP(pp_grepstart)
     if (PL_stack_base + *PL_markstack_ptr == SP) {
        (void)POPMARK;
        if (GIMME_V == G_SCALAR)
-           XPUSHs(&PL_sv_no);
+           XPUSHi(0);
        RETURNOP(PL_op->op_next->op_next);
     }
     PL_stack_sp = PL_stack_base + *PL_markstack_ptr + 1;