X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/dot-forward/blobdiff_plain/cbd69c7ae2a504b2f6e335c92319284f50290ac3..63ee33181bf4a66cf42a8be6df93c24bf924d2d9:/install.c diff --git a/install.c b/install.c index beec00c..59426df 100644 --- a/install.c +++ b/install.c @@ -5,7 +5,7 @@ #include "readwrite.h" #include "exit.h" -extern void hier(); +extern void hier(char *); #define FATAL "install: fatal: " @@ -99,13 +99,16 @@ int mode; strerr_die6sys(111,FATAL,"unable to chmod .../",subdir,"/",file,": "); } -void main() +void main(int argc, char *argv[]) { + char *home = 0; fdsourcedir = open_read("."); + if (argc > 1) + home = argv[1]; if (fdsourcedir == -1) strerr_die2sys(111,FATAL,"unable to open current directory: "); umask(077); - hier(); + hier(home); _exit(0); }