summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-20 17:50:38 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-20 17:50:38 +0000
commit5a211162cd360449f2dbfb7ca9231c025909353f (patch)
treecb1e381023629ae2b3d383210f275f479afdb348 /pp_sys.c
parent649da0762311e9a19091946020dc56feadc1378c (diff)
downloadperl-5a211162cd360449f2dbfb7ca9231c025909353f.tar.gz
default mkdir() mode argument to 0777
p4raw-id: //depot/perl@5164
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 8cba2edd71..f9db38e7ac 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3376,12 +3376,19 @@ S_dooneliner(pTHX_ char *cmd, char *filename)
PP(pp_mkdir)
{
djSP; dTARGET;
- int mode = POPi;
+ int mode;
#ifndef HAS_MKDIR
int oldumask;
#endif
STRLEN n_a;
- char *tmps = SvPV(TOPs, n_a);
+ char *tmps;
+
+ if (MAXARG > 1)
+ mode = POPi;
+ else
+ mode = 0777;
+
+ tmps = SvPV(TOPs, n_a);
TAINT_PROPER("mkdir");
#ifdef HAS_MKDIR