diff options
author | Craig A. Berry <craigberry@mac.com> | 2013-03-02 17:55:13 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2013-03-02 18:02:37 -0600 |
commit | 09f253ec43d3a97e7882a96f636670c1944f29ad (patch) | |
tree | 65d8b7a2a25ee8585cc598ee47ff2730fec1d5df /vms | |
parent | 9f351b45f43b0ed78a9b796af692ef90a6d23879 (diff) | |
download | perl-09f253ec43d3a97e7882a96f636670c1944f29ad.tar.gz |
Fix declaration after statement in vms.c's Perl_my_chdir
And while we're there, set errno appropriately for the empty string
input case.
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vms.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -2102,16 +2102,18 @@ int Perl_my_chdir(pTHX_ const char *dir) { STRLEN dirlen = strlen(dir); + const char *dir1 = dir; /* zero length string sometimes gives ACCVIO */ - if (dirlen == 0) return -1; - const char *dir1; + if (dirlen == 0) { + SETERRNO(EINVAL, SS$_BADPARAM); + return -1; + } /* Perl is passing the output of the DCL SHOW DEFAULT with leading spaces. * This does not work if DECC$EFS_CHARSET is active. Hack it here * so that existing scripts do not need to be changed. */ - dir1 = dir; while ((dirlen > 0) && (*dir1 == ' ')) { dir1++; dirlen--; |