don't allow sub-shells; English kindness
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 3 Aug 1989 07:08:32 +0000 (23:08 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Thu, 3 Aug 1989 07:08:32 +0000 (23:08 -0800)
SCCS-vsn: games/worm/worm.c 5.6

usr/src/games/worm/worm.c

index 1cd46d1..23a2d4e 100644 (file)
@@ -22,7 +22,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)worm.c     5.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)worm.c     5.6 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -77,9 +77,7 @@ char **argv;
        signal(SIGALRM, wake);
        signal(SIGINT, leave);
        signal(SIGQUIT, leave);
        signal(SIGALRM, wake);
        signal(SIGINT, leave);
        signal(SIGQUIT, leave);
-#ifdef SIGTSTP
        signal(SIGTSTP, suspend);       /* process control signal */
        signal(SIGTSTP, suspend);       /* process control signal */
-#endif
        initscr();
        crmode();
        noecho();
        initscr();
        crmode();
        noecho();
@@ -250,7 +248,7 @@ crash()
        clear();
        move(23, 0);
        refresh();
        clear();
        move(23, 0);
        refresh();
-       printf("Well you ran into something and the game is over.\n");
+       printf("Well, you ran into something and the game is over.\n");
        printf("Your final score was %d\n", score);
        leave();
 }
        printf("Your final score was %d\n", score);
        leave();
 }
@@ -263,15 +261,8 @@ suspend()
        refresh();
        endwin();
        fflush(stdout);
        refresh();
        endwin();
        fflush(stdout);
-#ifdef SIGTSTP
        kill(getpid(), SIGTSTP);
        signal(SIGTSTP, suspend);
        kill(getpid(), SIGTSTP);
        signal(SIGTSTP, suspend);
-#else
-       sh = getenv("SHELL");
-       if (sh == NULL)
-               sh = "/bin/sh";
-       system(sh);
-#endif
        crmode();
        noecho();
        setup();
        crmode();
        noecho();
        setup();