diff options
author | Craig A. Berry <craigberry@mac.com> | 2007-03-31 19:40:43 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-03-31 19:40:43 +0000 |
commit | 990cad080381a986101694ccc088bbec763448c6 (patch) | |
tree | 6cd20212bdf671ab889f822dc6ddb7c6e5280bcb /vms | |
parent | d7b3331898f84d163479fe03eff5bc0b654de391 (diff) | |
download | perl-990cad080381a986101694ccc088bbec763448c6.tar.gz |
Make Perl_vms_start_glob return the input pattern when there are
no matches.
p4raw-id: //depot/perl@30813
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vms.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -11961,6 +11961,7 @@ Perl_vms_start_glob } } if ((tmpfp = PerlIO_tmpfile()) != NULL) { + int found = 0; Stat_t st; int stat_sts; stat_sts = PerlLIO_stat(SvPVX_const(tmpglob),&st); @@ -11991,6 +11992,8 @@ Perl_vms_start_glob if (!$VMS_STATUS_SUCCESS(sts)) break; + found++; + /* with varying string, 1st word of buffer contains result length */ rstr[rslt->length] = '\0'; @@ -12038,6 +12041,14 @@ Perl_vms_start_glob ok = (PerlIO_puts(tmpfp,begin) != EOF); } if (cxt) (void)lib$find_file_end(&cxt); + + if (!found) { + /* Be POSIXish: return the input pattern when no matches */ + begin = SvPVX(tmpglob); + strcat(begin,"\n"); + ok = (PerlIO_puts(tmpfp,begin) != EOF); + } + if (ok && sts != RMS$_NMF && sts != RMS$_DNF && sts != RMS_FNF) ok = 0; if (!ok) { |