mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 04:21:24 +08:00
Fix GCC 3.4.4 warnings about ambigous else, in "else if" construct by
relying on the original indentation. Change exit(0) to return 0; to kill off warning about "non-void funtion".
This commit is contained in:
parent
5ffe54c277
commit
c76941f24f
@ -49,18 +49,21 @@ main(ac, av)
|
||||
|
||||
while ((p = readline(prompt)) != NULL) {
|
||||
(void)printf("\t\t\t|%s|\n", p);
|
||||
if (doit)
|
||||
if (doit) {
|
||||
if (strncmp(p, "cd ", 3) == 0) {
|
||||
if (chdir(&p[3]) < 0)
|
||||
if (chdir(&p[3]) < 0) {
|
||||
perror(&p[3]);
|
||||
}
|
||||
else if (system(p) != 0)
|
||||
}
|
||||
else if (system(p) != 0) {
|
||||
perror(p);
|
||||
}
|
||||
}
|
||||
add_history(p);
|
||||
free(p);
|
||||
}
|
||||
exit(0);
|
||||
/* NOTREACHED */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user