Correct a bug in cproto path resolution, correct a missing include for sys/select...
authorNick Downing <downing.nick@gmail.com>
Mon, 23 Jan 2017 03:53:28 +0000 (14:53 +1100)
committerNick Downing <downing.nick@gmail.com>
Mon, 23 Jan 2017 04:24:36 +0000 (15:24 +1100)
cproto-4.6/lex.l
include/Makefile
lib/libc/sys/select.c

index 71513e4..8840601 100644 (file)
@@ -996,8 +996,12 @@ char *file_spec;   /* path surrounded by "" or <> */
   if (q[-1] == '/') {
    if (stack[level - 1] == q - 1 || (stack[level - 1] == q - 2 && q[-2] == '.'))
     q = stack[level - 1];
-   else if (level >= 2 && stack[level - 1] == q - 3 && q[-3] == '.' && q[-2] == '.')
-    q = stack[--level - 1];
+   else if (stack[level - 1] == q - 3 && q[-3] == '.' && q[-2] == '.') {
+    if (level >= 2)
+     q = stack[--level - 1];
+    else
+     stack[level - 1] = q;
+   }
    else
     stack[level++] = q;
   }
index 0001d4d..d74d9e7 100644 (file)
@@ -19,9 +19,9 @@
 DESTDIR=
 SUBDIRS=arpa pascal protocols
 STD=   a.out.h ar.h assert.h ctype.h disktab.h fstab.h gen.h grp.h lastlog.h \
-       math.h memory.h mtab.h ndbm.h netdb.h pcc.h pwd.h ranlib.h resolv.h \
-       setjmp.h sgtty.h stab.h stdio.h string.h strings.h struct.h syscall.h \
-       sysexits.h time.h ttyent.h utmp.h varargs.h vfont.h
+       math.h memory.h mtab.h ndbm.h net.h netdb.h pcc.h pwd.h ranlib.h \
+       resolv.h setjmp.h sgtty.h stab.h stdio.h string.h strings.h struct.h \
+       syscall.h sysexits.h time.h ttyent.h utmp.h varargs.h vfont.h
 LINKS= errno.h signal.h syslog.h
 MACHINE=vax
 MACHDEP=${MACHINE} vaxif vaxmba vaxuba
@@ -32,10 +32,11 @@ TAGSFILE=tags
 
 all:
 
+# Nick has changed -m 444 to -m 644 below (it is really silly)
 install: ${SHARED}
        -for i in ${STD}; do \
                cmp -s $$i ${DESTDIR}/usr/include/$$i || \
-                   install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \
+                   install -c -m 644 $$i ${DESTDIR}/usr/include/$$i; \
        done
        -for i in ${SUBDIRS}; do \
                if [ ! -d ${DESTDIR}/usr/include/$$i ]; \
@@ -44,11 +45,11 @@ install: ${SHARED}
                fi; \
                (cd $$i; for j in *.[ih]; do \
                        cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
-                       install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
+                       install -c -m 644 $$j ${DESTDIR}/usr/include/$$i/$$j; \
                done); \
        done
        -cmp -s Makefile.install ${DESTDIR}/usr/include/Makefile || \
-           install -c -m 444 Makefile.install ${DESTDIR}/usr/include/Makefile
+           install -c -m 644 Makefile.install ${DESTDIR}/usr/include/Makefile
        -for i in ${LINKS}; do \
                rm -f ${DESTDIR}/usr/include/$$i; \
                ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
index 7e58ab5..2039f1c 100644 (file)
@@ -1,5 +1,5 @@
+#include <sys/select.h>
 #include <sys/time.h>
-#include <sys/types.h>
 
 int select(n, r, w, e, t) fd_set *r, *w, *e; struct timeval *t; {
        write(2, "select()\n", 9);