Fixed dialog arguments error.
This commit is contained in:
parent
b3e71d13aa
commit
5700238509
@ -119,7 +119,7 @@ static int on_command_line(GApplication *app, GApplicationCommandLine *cmdline,
|
|||||||
argv = g_application_command_line_get_arguments(cmdline, &argc);
|
argv = g_application_command_line_get_arguments(cmdline, &argc);
|
||||||
|
|
||||||
// Handle your arguments here
|
// Handle your arguments here
|
||||||
if (argc >= 4) {
|
if (argc >= 5) {
|
||||||
fprintf(stderr, "%s\n", argv[1]);
|
fprintf(stderr, "%s\n", argv[1]);
|
||||||
g_object_set_data_full(G_OBJECT(app), "accessing_pid", g_strdup(argv[1]),
|
g_object_set_data_full(G_OBJECT(app), "accessing_pid", g_strdup(argv[1]),
|
||||||
g_free);
|
g_free);
|
||||||
@ -145,7 +145,7 @@ int main(int argc, char **argv) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argc != 4) {
|
if (argc != 5) {
|
||||||
fprintf(stdout, "Usage: icfs_dialogue [accessing pid] [accessing name] "
|
fprintf(stdout, "Usage: icfs_dialogue [accessing pid] [accessing name] "
|
||||||
"[root folder] [access dir]");
|
"[root folder] [access dir]");
|
||||||
return 255;
|
return 255;
|
||||||
|
@ -146,9 +146,6 @@ struct dialogue_response ask_access(const char *filename,
|
|||||||
push(&dialogue_output, '/');
|
push(&dialogue_output, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate string length consistency
|
|
||||||
assert(strlen(first(&dialogue_output)) == size(&dialogue_output));
|
|
||||||
|
|
||||||
// Allocate and copy final filename
|
// Allocate and copy final filename
|
||||||
response.filename = malloc(size(&dialogue_output) + 1);
|
response.filename = malloc(size(&dialogue_output) + 1);
|
||||||
strcpy(response.filename, first(&dialogue_output));
|
strcpy(response.filename, first(&dialogue_output));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user