None of these work without the proper # of arguments so print usage

This commit is contained in:
sin
2013-08-31 23:04:49 +01:00
parent 355911f010
commit 428cd4fe84
6 changed files with 27 additions and 0 deletions

3
mv.c
View File

@@ -25,6 +25,9 @@ main(int argc, char *argv[])
usage();
} ARGEND;
if (argc < 2)
usage();
if(argc > 3 && !(stat(argv[argc-1], &st) == 0 && S_ISDIR(st.st_mode)))
eprintf("%s: not a directory\n", argv[argc-1]);
enmasse(argc, &argv[0], mv);