Skip to content
Snippets Groups Projects
Commit 57be9e29 authored by yorhel's avatar yorhel
Browse files

Current directory is assumed when no directory is given on the commandline...

Current directory is assumed when no directory is given on the commandline (more du-like), and give a proper error if a given dir exceeds PATH_MAX

git-svn-id: svn://blicky.net/ncdu/trunk@43 ce56bc8d-f834-0410-b703-f827bd498a76
parent fec2f9a1
No related branches found
No related tags found
No related merge requests found
svn - ?
- Fixed incorrect apparent size on directory refresh
- Browsing keys now work while file info window is displayed
- Current directory is assumed when no directory is specified
1.4 - 2008-09-10
- Removed the startup window
......
......@@ -43,7 +43,6 @@ void parseCli(int argc, char **argv) {
sflags = 0;
sdelay = 100;
bflags = BF_SIZE | BF_DESC;
sdir[0] = '\0';
/* read from commandline */
for(i=1; i<argc; i++) {
......@@ -88,14 +87,12 @@ void parseCli(int argc, char **argv) {
} else {
sdir[PATH_MAX - 1] = 0;
strncpy(sdir, argv[i], PATH_MAX);
if(sdir[PATH_MAX - 1] != 0)
sdir[0] = 0;
if(sdir[PATH_MAX - 1] != 0) {
printf("Error: path length exceeds PATH_MAX\n");
exit(1);
}
}
}
if(!sdir[0]) {
printf("Please specify a directory.\nSee '%s -h' for more information.\n", argv[0]);
exit(1);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment