aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c
index af63ed3c4f..105f676bbd 100644
--- a/src/main.c
+++ b/src/main.c
@@ -86,7 +86,7 @@ typedef struct {
int window_count; /* number of windows to use */
int window_layout; /* 0, WIN_HOR, WIN_VER or WIN_TABS */
-#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
+#if !defined(UNIX)
int literal; /* don't expand file names */
#endif
int diff_mode; /* start with 'diff' set */
@@ -99,7 +99,7 @@ typedef struct {
#define EDIT_TAG 3 /* tag name argument given, use tagname */
#define EDIT_QF 4 /* start in quickfix mode */
-#if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
+#if defined(UNIX) && !defined(NO_VIM_MAIN)
static int file_owned(char *fname);
#endif
static void mainerr(int, char_u *);
@@ -278,7 +278,6 @@ static char *(main_errors[]) =
/*
* mch_init() sets up the terminal (window) for use. This must be
* done after resetting full_screen, otherwise it may move the cursor
- * (MSDOS).
* Note that we may use mch_exit() before mch_init()!
*/
mch_init();
@@ -411,7 +410,7 @@ static char *(main_errors[]) =
if (params.edit_type == EDIT_STDIN && !recoverymode)
read_stdin();
-#if defined(UNIX) || defined(VMS)
+#if defined(UNIX)
/* When switching screens and something caused a message from a vimrc
* script, need to output an extra newline on exit. */
if ((did_emsg || msg_didout) && *T_TI != NUL)
@@ -1055,7 +1054,7 @@ static void command_line_scan(mparm_T *parmp)
msg_didout = FALSE;
mch_exit(0);
} else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) {
-#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
+#if !defined(UNIX)
parmp->literal = TRUE;
#endif
} else if (STRNICMP(argv[0] + argv_idx, "nofork", 6) == 0) {
@@ -1443,7 +1442,7 @@ scripterror:
#endif
alist_add(&global_alist, p,
-#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
+#if !defined(UNIX)
parmp->literal ? 2 : 0 /* add buffer nr after exp. */
#else
2 /* add buffer number now and use curbuf */
@@ -1534,7 +1533,7 @@ static void check_and_set_isatty(mparm_T *paramp)
*/
static char_u *get_fname(mparm_T *parmp)
{
-#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
+#if !defined(UNIX)
/*
* Expand wildcards in file names.
*/
@@ -2026,7 +2025,7 @@ static void source_startup_scripts(mparm_T *parmp)
* SYS_VIMRC_FILE.
*/
if (p_exrc) {
-#if defined(UNIX) || defined(VMS)
+#if defined(UNIX)
/* If ".vimrc" file is not owned by user, set 'secure' mode. */
if (!file_owned(VIMRC_FILE))
#endif
@@ -2051,7 +2050,7 @@ static void source_startup_scripts(mparm_T *parmp)
i = do_source((char_u *)VIMRC_FILE, TRUE, DOSO_VIMRC);
if (i == FAIL) {
-#if defined(UNIX) || defined(VMS)
+#if defined(UNIX)
/* if ".exrc" is not owned by user set 'secure' mode */
if (!file_owned(EXRC_FILE))
secure = p_secure;
@@ -2121,7 +2120,7 @@ process_env (
return FAIL;
}
-#if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
+#if defined(UNIX) && !defined(NO_VIM_MAIN)
/*
* Return TRUE if we are certain the user owns the file "fname".
* Used for ".vimrc" and ".exrc".
@@ -2130,11 +2129,7 @@ process_env (
static int file_owned(char *fname)
{
struct stat s;
-# ifdef UNIX
uid_t uid = getuid();
-# else /* VMS */
- uid_t uid = ((getgid() << 16) | getuid());
-# endif
return !(mch_stat(fname, &s) != 0 || s.st_uid != uid
# ifdef HAVE_LSTAT
@@ -2212,7 +2207,7 @@ static void usage(void)
mch_msg(_("\n\nArguments:\n"));
main_msg(_("--\t\t\tOnly file names after this"));
-#if (!defined(UNIX) && !defined(__EMX__)) || defined(ARCHIE)
+#if !defined(UNIX)
main_msg(_("--literal\t\tDon't expand wildcards"));
#endif
main_msg(_("-v\t\t\tVi mode (like \"vi\")"));