commit 9c177e8d04414b7be4a02d64ed06dcc402a7b0a8 from: Omar Polo date: Mon Mar 18 13:34:07 2024 UTC use a define for vi(1) path This is intended to aid -portable, since other systems may have vi installed in a different place, or maybe prefer to ship with a different default editor. ok stsp@ commit - c5d61cbc3a9c337b669af6b330709b6b4d43c872 commit + 9c177e8d04414b7be4a02d64ed06dcc402a7b0a8 blob - 395b21d6bf1ba81c76d54f3c0c75a094440ca583 blob + 88729baf00e38ec442bf51dbd5f42196934e953a --- cvg/cvg.c +++ cvg/cvg.c @@ -67,6 +67,10 @@ #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + +#ifndef GOT_DEFAULT_EDITOR +#define GOT_DEFAULT_EDITOR "/usr/bin/vi" #endif static volatile sig_atomic_t sigint_received; @@ -281,7 +285,7 @@ get_editor(char **abspath) } if (*abspath == NULL) { - *abspath = strdup("/usr/bin/vi"); + *abspath = strdup(GOT_DEFAULT_EDITOR); if (*abspath == NULL) return got_error_from_errno("strdup"); } blob - 488dc79c339ccc7d9f24681ea94bbf19ab7b4309 blob + 1a1732a2994a8428496e498b70ebb81e222507aa --- got/got.c +++ got/got.c @@ -66,6 +66,10 @@ #ifndef nitems #define nitems(_a) (sizeof((_a)) / sizeof((_a)[0])) +#endif + +#ifndef GOT_DEFAULT_EDITOR +#define GOT_DEFAULT_EDITOR "/usr/bin/vi" #endif static volatile sig_atomic_t sigint_received; @@ -310,7 +314,7 @@ get_editor(char **abspath) } if (*abspath == NULL) { - *abspath = strdup("/usr/bin/vi"); + *abspath = strdup(GOT_DEFAULT_EDITOR); if (*abspath == NULL) return got_error_from_errno("strdup"); }