From: Todd C. Miller Date: Sat, 17 Dec 1994 23:18:26 +0000 (+0000) Subject: now only do Editor +line_num if line_num != 0 X-Git-Tag: SUDO_1_4_0~661 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bd269bd8e84d95d1eca8df4d87f55666ec6004d;p=sudo now only do Editor +line_num if line_num != 0 --- diff --git a/visudo.c b/visudo.c index aeba7f2e1..997a8172a 100644 --- a/visudo.c +++ b/visudo.c @@ -98,9 +98,7 @@ main(argc, argv) int num_chars; struct stat sbuf; struct passwd *sudoers_pw; -#ifdef ENV_EDITOR - char * Editor; -#endif /* ENV_EDITOR */ + char * Editor = EDITOR; #ifdef POSIX_SIGNALS struct sigaction action; #endif /* POSIX_SIGNALS */ @@ -214,13 +212,11 @@ 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 */ + if (err_line_no) + (void) sprintf(buffer, "%s +%d %s", Editor, err_line_no, + sudoers_tmp_file); + else + (void) sprintf(buffer, "%s %s", Editor, sudoers_tmp_file); /* edit the file */ if (system(buffer) == 0) {