summaryrefslogtreecommitdiff
path: root/vms/vms.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2013-03-02 17:55:13 -0600
committerCraig A. Berry <craigberry@mac.com>2013-03-02 18:02:37 -0600
commit09f253ec43d3a97e7882a96f636670c1944f29ad (patch)
tree65d8b7a2a25ee8585cc598ee47ff2730fec1d5df /vms/vms.c
parent9f351b45f43b0ed78a9b796af692ef90a6d23879 (diff)
downloadperl-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/vms.c')
-rw-r--r--vms/vms.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 82b5d16ab7..58de70d40a 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -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--;