Added dialogue file existence checks
This commit is contained in:
parent
5dff492663
commit
1b53a9638e
@ -244,9 +244,15 @@ int interactive_access(const char *filename, struct process_info proc_info,
|
|||||||
// the user might specify a different file in the dialogue, so we need to
|
// the user might specify a different file in the dialogue, so we need to
|
||||||
// check if it is valid
|
// check if it is valid
|
||||||
|
|
||||||
while (source_access(response.filename, F_OK)) {
|
while (
|
||||||
|
source_access(response.filename, F_OK) ||
|
||||||
|
!(strncmp(response.filename, filename, strlen(response.filename)) == 0 &&
|
||||||
|
((strlen(response.filename) < strlen(filename) &&
|
||||||
|
response.filename[strlen(response.filename) - 1] == '/') ||
|
||||||
|
(strlen(response.filename) == strlen(filename))))) {
|
||||||
// if it is invalid, just ask again.
|
// if it is invalid, just ask again.
|
||||||
fprintf(stderr, "[ICFS] Filename returned by zenty wasn't correct: %s\n",
|
fprintf(stderr,
|
||||||
|
"[ICFS] Filename returned by access dialogue wasn't correct: %s\n",
|
||||||
response.filename);
|
response.filename);
|
||||||
free(response.filename);
|
free(response.filename);
|
||||||
response = ask_access(filename, proc_info);
|
response = ask_access(filename, proc_info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user