projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove gpib, ib
[unix-history]
/
usr
/
src
/
usr.bin
/
rdist
/
main.c
diff --git
a/usr/src/usr.bin/rdist/main.c
b/usr/src/usr.bin/rdist/main.c
index
ac4c898
..
78520e4
100644
(file)
--- a/
usr/src/usr.bin/rdist/main.c
+++ b/
usr/src/usr.bin/rdist/main.c
@@
-1,5
+1,5
@@
#ifndef lint
#ifndef lint
-static char *sccsid = "@(#)main.c 4.1
4 (Berkeley) 85/02/04
";
+static char *sccsid = "@(#)main.c 4.1
5 (Berkeley) 85/05/16
";
#endif
#include "defs.h"
#endif
#include "defs.h"
@@
-10,7
+10,7
@@
static char *sccsid = "@(#)main.c 4.14 (Berkeley) 85/02/04";
* Remote distribution program.
*/
* Remote distribution program.
*/
-char *distfile =
"distfile"
;
+char *distfile =
NULL
;
char tmpfile[] = "/tmp/rdistXXXXXX";
char *tmpname = &tmpfile[5];
char tmpfile[] = "/tmp/rdistXXXXXX";
char *tmpname = &tmpfile[5];
@@
-150,9
+150,16
@@
main(argc, argv)
if (cmdargs)
docmdargs(argc, argv);
else {
if (cmdargs)
docmdargs(argc, argv);
else {
- if (fin == NULL && (fin = fopen(distfile, "r")) == NULL) {
- perror(distfile);
- exit(1);
+ if (fin == NULL) {
+ if(distfile == NULL) {
+ if((fin = fopen("distfile","r")) == NULL)
+ fin = fopen("Distfile", "r");
+ } else
+ fin = fopen(distfile, "r");
+ if(fin == NULL) {
+ perror(distfile ? distfile : "distfile");
+ exit(1);
+ }
}
yyparse();
if (nerrs == 0)
}
yyparse();
if (nerrs == 0)