mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
main: -D,--working-directory: check path exists and is a directory
This commit is contained in:
parent
37c4917e8e
commit
f896f12967
1 changed files with 7 additions and 1 deletions
8
main.c
8
main.c
|
|
@ -236,9 +236,15 @@ main(int argc, char *const *argv)
|
|||
conf_app_id = optarg;
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
case 'D': {
|
||||
struct stat st;
|
||||
if (stat(optarg, &st) < 0 || !(st.st_mode & S_IFDIR)) {
|
||||
fprintf(stderr, "error: %s: not a directory\n", optarg);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
custom_cwd = optarg;
|
||||
break;
|
||||
}
|
||||
|
||||
case 'f':
|
||||
tll_free_and_free(conf_fonts, free);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue