From: Todd C. Miller Date: Wed, 26 Jan 1994 23:52:13 +0000 (+0000) Subject: now uses ENV_EDITOR if you want to use the EDITOR envar X-Git-Tag: SUDO_1_3_0~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=40013231bf381cbc9db0aa12bc745f299add3d19;p=sudo now uses ENV_EDITOR if you want to use the EDITOR envar --- diff --git a/visudo.c b/visudo.c index 13366b247..59f8fa6cc 100644 --- a/visudo.c +++ b/visudo.c @@ -79,7 +79,9 @@ main(argc, argv) { int fd; struct stat sbuf; +#ifdef ENV_EDITOR char * Editor; +#endif /* ENV_EDITOR */ /* * handle the signals @@ -101,14 +103,14 @@ main(argc, argv) */ umask(077); +#ifdef ENV_EDITOR /* * set up the Editor variable correctly */ -#ifndef STATICEDITOR if ( (Editor = getenv("EDITOR")) == NULL) if ( (Editor = getenv("VISUAL")) == NULL ) -#endif /* !STATICEDITOR */ Editor = EDITOR; +#endif /* ENV_EDITOR */ /* * open the sudoers file read only @@ -155,8 +157,13 @@ main(argc, argv) /* * build strings in buffer to be executed by system() */ +#ifdef ENV_EDITOR (void) sprintf(buffer, "%s +%d %s", Editor, err_line_no, sudoers_tmp_file); +#else + (void) sprintf(buffer, "%s +%d %s", EDITOR, err_line_no, + sudoers_tmp_file); +#endif /* ENV_EDITOR */ /* edit the file */ if (system(buffer) == 0) {