allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (02/26/89)
Posting-number: Volume 6, Issue 40 Submitted-by: djk@munnari.UUCP Archive-name: redir.unpat1 [Unofficial patches; keep the original in case the author posts official ones. ++bsa] { Something seems to have munged the tabs on v06i031 before they got to uunet. I had to unexpand -a, and manually expand a couple of unexpand's mistakes. } Here are some improvements to make "redir" a bit more robust: *** redir.c Mon Feb 6 19:06:28 1989 --- redir.new.c Mon Feb 6 19:02:33 1989 *************** *** 151,154 **** --- 151,161 ---- close(fd); } + + if (argv[optind] == NULL) { + fprintf(stderr, USAGESTRING, argv[0]); + exit(1); + } execvp(argv[optind], argv + optind); + fprintf(stderr, "%s: ", argv[0]); + perror(argv[optind]); } David Keegel (djk%munnari.oz.AU@uunet.UU.NET)