Copy over the old logic deciding which $EDITOR to use for edit-perms #69

Open
opened 2024-08-19 02:28:53 +02:00 by oysteikt · 0 comments
Owner

editor = getenv("EDITOR");
if (!editor)
editor = "pico"; /* OK since editor won't be freed */
cmd = malloc(sizeof(char) * strlen(editor) + 7);
sprintf(cmd, "%s \"$1\"", editor);
/* sh -c '$EDITOR "$1"' sh "$fn" */
execlp("sh", "sh", "-c", cmd, "sh", fn, NULL);
perror("Failed to execute editor");
fprintf(stderr, "Make sure the EDITOR environment variable contains"
" a valid editor\n");

https://git.pvv.ntnu.no/Projects/mysql-admutils/src/commit/f290245b41ff4c5c8844933634ac752f9d6aa1d5/mysql-dbadm.c#L421-L432
oysteikt added the buggood first issue labels 2024-08-19 02:28:53 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Projects/muscl#69