version 1.11, 2002/01/03 03:49:16 |
version 1.12, 2002/01/17 16:48:01 |
|
|
#include "version.h" |
#include "version.h" |
|
|
#ifndef lint |
#ifndef lint |
static const char rcsid[] = "$Sudo: visudo.c,v 1.145 2001/12/14 19:52:48 millert Exp $"; |
static const char rcsid[] = "$Sudo: visudo.c,v 1.146 2002/01/17 15:35:54 millert Exp $"; |
#endif /* lint */ |
#endif /* lint */ |
|
|
/* |
/* |
|
|
* See if we can use the user's choice of editors either because |
* See if we can use the user's choice of editors either because |
* we allow any $EDITOR or because $EDITOR is in the allowable list. |
* we allow any $EDITOR or because $EDITOR is in the allowable list. |
*/ |
*/ |
Editor = NULL; |
Editor = EditorPath = NULL; |
if (def_flag(I_ENV_EDITOR) && UserEditor) |
if (def_flag(I_ENV_EDITOR) && UserEditor) |
Editor = UserEditor; |
Editor = UserEditor; |
else if (UserEditor) { |
else if (UserEditor) { |
|
|
break; |
break; |
} |
} |
} while ((Editor = strtok(NULL, ":"))); |
} while ((Editor = strtok(NULL, ":"))); |
free(EditorPath); |
|
} |
} |
|
|
/* |
/* |
|
|
* find one that exists, is regular, and is executable. |
* find one that exists, is regular, and is executable. |
*/ |
*/ |
if (Editor == NULL || *Editor == '\0') { |
if (Editor == NULL || *Editor == '\0') { |
|
if (EditorPath != NULL) |
|
free(EditorPath); |
EditorPath = estrdup(def_str(I_EDITOR)); |
EditorPath = estrdup(def_str(I_EDITOR)); |
Editor = strtok(EditorPath, ":"); |
Editor = strtok(EditorPath, ":"); |
do { |
do { |