summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:33 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-11-17 03:02:33 +0000
commit0d3e774cdb279a1eadd8282d49334b9b1bfd42ed (patch)
treefb045eec0f917ecabe28bd3c3c3d20dcdd27aae2 /doio.c
parentae98613044a1084886d80b8283b25bad38cfd171 (diff)
downloadperl-0d3e774cdb279a1eadd8282d49334b9b1bfd42ed.tar.gz
perl 3.0 patch #5 (combined patch)
Some machines have bcopy() but not bzero(), so Configure tests for them separately now. Likewise for symlink() and lstat(). Some systems have dirent.h but not readdir(). The symbols BZERO, LSTAT and READDIR are now used to differentiate. Some machines have <time.h> including <sys/time.h>. Some do the opposite. Some don't even have <sys/time.h>. Configure now looks for both kinds of include, and the saga continues... Configure tested twice for the presence of -lnm because x2p/Makefile.SH had a reference to the obsolete $libnm variable. It now tests only once. Some machines have goodies stashed in /usr/include/sun, /usr/include/bsd, -lsun and -lbsd. Configure now checks those locations. Configure could sometimes add an option to a default of none, producing [none -DDEBUGGING] prompts. This is fixed. Many of the units in metaconfig used the construct if xxx=`loc...`; then On most machines the exit status of loc ends up in $?, but on a few machines, the assignment apparently sets $? to 0, since it always succeeds. Oh well... The tests for byte order had difficulties with illegal octal digits and constants that were too long, as well as not defining the union in try.c correctly. When <dirent.h> was missing, it was assumed that the field d_namlen existed. There is now an explicit check of <sys/dir.h> for the field. The tests of <signal.h> to see how signal() is declared needed to have signal.h run through the C preprocessor first because of POSIX ifdefs. The type returned by getgroups() was defaulting wrong on Suns and such. Configure now checks against the lint library if it exists to produce a better default. The construct foreach $elem (@array) { foreach $elem (@array) { ... } } didn't work right because the iterator for the array was stored with the array rather than with the node in the syntax tree. If you said defined $foo{'bar'} it would create the element $foo{'bar'} while returning the correct value. It now no longer creates the value. The grep() function was occasionally losing arguments or dumping core. This was because it called eval() on each argument but didn't account for the fact that eval() is capable of reallocating the stack. If you said $something ? $foo[1] : $foo[2] you ended up (usually) with $something ? $foo[0] : $foo[0] because of the way the ?: operator tries to fool the stack into thinking there's only one argument there instead of three. This only happened to constant subscripts. Interestingly enough, $abc[1] ? $foo[1] : $bar[1] would have worked, since the first argument has the same subscript. Some machines already define TRUE and FALSE, so we have to undef them to avoid warnings. Several people sent in some fixes for manual typos and indent problems. There was a reqeust to clarify the difference between $! and $@, and I added a gratuitous warning about print making an array context for its arguments, since people seem to run into that frequently. suidperl could correctly emulate a setgid script, but then it could get confused about what the actual effective gid was. Some machine or other defines sighandler(), so perl's sighandler() needed to be made static. We changed uchar to unchar for Crays, and it turns out that lots of SysV machines typedef unchar instead. Sigh. It's now un_char. If you did substitutions to chop leading components off a string, and then set the string from <filehandle>, under certain circumstances the input string could be corrupted because str_gets() called str_grow() without making sure to change the strings current length to be the number of characters just read, rather than the old length. op.stat occasionally failed with NFS race condition, so it now waits two seconds instead of one to guarantee that the NFS server advances its clock at least one second. IBM PC/RT compiler can't deal with UNI() and LOP() macros. If you define CRIPPLED_CC it now will recast those macros as subroutines, which runs a little slower but doesn't give the compiler heartburn. The } character can terminate either an associative array subscript or a BLOCK. These set up different expectations as to whether the next token might be a term or an operator. There was a faulty heuristic based on whether there was an intervening newline. It turns out that if } simply leaves the current expectations along, the right thing happens. The command y/abcde// didn't work because the length of the first part was not correctly copied to the second part. In s2p, line labels without a subsequent statement were done wrong, since an extra semicolon needs to be supplied. It wasn't always suppplied, and when it was supplied, it was in the wrong place. S2p also needed to remove its /tmp files better. A2p translates for (a in b) to foreach $a} (keys(%b)) on Pyramids, because index(s, '}' + 128) doesn't find a } with the top bit set. This has been fixed.
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/doio.c b/doio.c
index a2960ad526..38840358e3 100644
--- a/doio.c
+++ b/doio.c
@@ -1,4 +1,4 @@
-/* $Header: doio.c,v 3.0.1.2 89/11/11 04:25:51 lwall Locked $
+/* $Header: doio.c,v 3.0.1.3 89/11/17 15:13:06 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,10 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: doio.c,v $
+ * Revision 3.0.1.3 89/11/17 15:13:06 lwall
+ * patch5: some systems have symlink() but not lstat()
+ * patch5: some systems have dirent.h but not readdir()
+ *
* Revision 3.0.1.2 89/11/11 04:25:51 lwall
* patch2: orthogonalized the file modes some so we can have <& +<& etc.
* patch2: do_open() now detects sockets passed to process from parent
@@ -510,7 +514,7 @@ int *arglast;
else {
str_sset(statname,ary->ary_array[sp]);
statstab = Nullstab;
-#ifdef SYMLINK
+#ifdef LSTAT
if (arg->arg_type == O_LSTAT)
i = lstat(str_get(statname),&statcache);
else
@@ -1717,7 +1721,7 @@ STAB *stab;
int gimme;
int *arglast;
{
-#ifdef DIRENT
+#if defined(DIRENT) && defined(READDIR)
register ARRAY *ary = stack;
register STR **st = ary->ary_array;
register int sp = arglast[1];
@@ -1892,7 +1896,7 @@ int *arglast;
tot--;
}
else { /* don't let root wipe out directories without -U */
-#ifdef SYMLINK
+#ifdef LSTAT
if (lstat(s,&statbuf) < 0 ||
#else
if (stat(s,&statbuf) < 0 ||