This commit allows &CORE::umask to be called through references and
via ampersand syntax. pp_umask is modified to take into account the
nulls pushed on to the stack in pp_coreargs, which happens because
pp_coreargs has no other way to tell umask how many arguments it’s
actually getting. See commit
0163043a for details.
case KEY_splice:
case KEY_stat:
case KEY_system:
- case KEY_truncate: case KEY_umask: case KEY_unlink:
+ case KEY_truncate: case KEY_unlink:
case KEY_unpack: case KEY_unshift:
case KEY_values: case KEY_write:
ampable = FALSE;
dTARGET;
Mode_t anum;
- if (MAXARG < 1) {
+ if (MAXARG < 1 || (!TOPs && !POPs)) {
anum = PerlLIO_umask(022);
/* setting it to 022 between the two calls to umask avoids
* to have a window where the umask is set to 0 -- meaning
/* Only DIE if trying to restrict permissions on "user" (self).
* Otherwise it's harmless and more useful to just return undef
* since 'group' and 'other' concepts probably don't exist here. */
- if (MAXARG >= 1 && (POPi & 0700))
+ if (MAXARG >= 1 && (TOPs||POPs) && (POPi & 0700))
DIE(aTHX_ "umask not implemented");
XPUSHs(&PL_sv_undef);
#endif
test_proto 'uc', 'aa', 'AA';
test_proto 'ucfirst', 'aa', "Aa";
+
+test_proto 'umask';
+$tests ++;
+is &myumask, umask, '&umask with no args';
+
test_proto 'untie'; # behaviour already tested along with tie(d)
test_proto 'utime';