minor bug fixes
authorBill Joy <wnj@ucbvax.Berkeley.EDU>
Thu, 12 Mar 1981 10:52:01 +0000 (02:52 -0800)
committerBill Joy <wnj@ucbvax.Berkeley.EDU>
Thu, 12 Mar 1981 10:52:01 +0000 (02:52 -0800)
SCCS-vsn: bin/csh/csh.c 4.2
SCCS-vsn: bin/csh/glob.c 4.2
SCCS-vsn: bin/csh/proc.c 4.3

usr/src/bin/csh/csh.c
usr/src/bin/csh/glob.c
usr/src/bin/csh/proc.c

index 9109e26..9aa7083 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)csh.c 4.1 %G%";
+static char *sccsid = "@(#)csh.c 4.2 %G%";
 
 #include "sh.h"
 #include <sys/ioctl.h>
 
 #include "sh.h"
 #include <sys/ioctl.h>
@@ -558,6 +558,12 @@ char       *jobargv[2] = { "jobs", 0 };
  * gets a chance to make the shell go away.
  */
 pintr()
  * gets a chance to make the shell go away.
  */
 pintr()
+{
+       pintr1(1);
+}
+
+pintr1(wantnl)
+       bool wantnl;
 {
        register char **v;
 
 {
        register char **v;
 
@@ -588,7 +594,7 @@ pintr()
                if (v = gargv)
                        gargv = 0, blkfree(v);
                reset();
                if (v = gargv)
                        gargv = 0, blkfree(v);
                reset();
-       } else if (intty)
+       } else if (intty && wantnl)
                printf("\n");           /* Some like this, others don't */
        error(NOSTR);
 }
                printf("\n");           /* Some like this, others don't */
        error(NOSTR);
 }
index 80a77a3..7e9d357 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)glob.c 4.1 %G%";
+static char *sccsid = "@(#)glob.c 4.2 %G%";
 #include "sh.h"
 
 /*
 #include "sh.h"
 
 /*
@@ -75,9 +75,10 @@ collect(as)
 #ifdef GDEBUG
                printf("acollect done\n");
 #endif
 #ifdef GDEBUG
                printf("acollect done\n");
 #endif
-       } else if (noglob)
+       } else if (noglob || eq(as, "{") || eq(as, "{}")) {
                Gcat(as, "");
                Gcat(as, "");
-       else
+               sort();
+       } else
                acollect(as);
 }
 
                acollect(as);
 }
 
index f11a7e6..ce717c0 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)proc.c 4.2 %G%";
+static char *sccsid = "@(#)proc.c 4.3 %G%";
 
 #include "sh.h"
 #include "sh.dir.h"
 
 #include "sh.h"
 #include "sh.dir.h"
@@ -127,9 +127,7 @@ found:
                            jobflags & PAEXITED ||
 #endif
                            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
                            jobflags & PAEXITED ||
 #endif
                            !eq(dcwd->di_name, fp->p_cwd->di_name)) {
-                               if (jobflags & PSTOPPED)
-                                       printf("\n");
-                               pprint(fp, AREASON|SHELLDIR);
+                               ;       /* print in pjwait */
                        } else if ((jobflags & (PTIME|PSTOPPED)) == PTIME)
                                ptprint(fp);
                } else {
                        } else if ((jobflags & (PTIME|PSTOPPED)) == PTIME)
                                ptprint(fp);
                } else {
@@ -226,12 +224,15 @@ pjwait(pp)
        sigrelse(SIGCHLD);
        if (tpgrp > 0)
                ioctl(FSHTTY, TIOCSPGRP, &tpgrp);       /* get tty back */
        sigrelse(SIGCHLD);
        if (tpgrp > 0)
                ioctl(FSHTTY, TIOCSPGRP, &tpgrp);       /* get tty back */
-       if (jobflags & PSTOPPED)
-               return;
-       if ((jobflags&PINTERRUPTED) && setintr &&
+       if ((jobflags&(PINTERRUPTED|PSTOPPED)) && setintr &&
            (!gointr || !eq(gointr, "-"))) {
            (!gointr || !eq(gointr, "-"))) {
-               pflush(pp);
-               pintr();
+               if ((jobflags & PSTOPPED) == 0)
+                       pflush(pp);
+               else {
+                       printf("\n");
+                       pprint(pp, AREASON|SHELLDIR);
+               }
+               pintr1(0);
                /*NOTREACHED*/
        }
        reason = 0;
                /*NOTREACHED*/
        }
        reason = 0;