diff options
author | Stefan Hoffmann <stefan991@gmail.com> | 2014-04-08 22:32:14 +0200 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-04-11 13:31:48 -0300 |
commit | c1961ee0df4ec99de0e6ec0aa8718bb7c263571e (patch) | |
tree | 7c70dd6ca293d889b99b65bce27a3970344eb0c1 | |
parent | 96ddc0198d701db7f4e114d3cc4859456e117c97 (diff) | |
download | rneovim-c1961ee0df4ec99de0e6ec0aa8718bb7c263571e.tar.gz rneovim-c1961ee0df4ec99de0e6ec0aa8718bb7c263571e.tar.bz2 rneovim-c1961ee0df4ec99de0e6ec0aa8718bb7c263571e.zip |
removed vim_mkdir macro
-rw-r--r-- | src/eval.c | 6 | ||||
-rw-r--r-- | src/ex_docmd.c | 11 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/os_unix_defs.h | 2 | ||||
-rw-r--r-- | src/spell.c | 7 |
5 files changed, 8 insertions, 20 deletions
diff --git a/src/eval.c b/src/eval.c index 0c6f2911b3..81b37b50fa 100644 --- a/src/eval.c +++ b/src/eval.c @@ -663,9 +663,7 @@ static void f_matchlist(typval_T *argvars, typval_T *rettv); static void f_matchstr(typval_T *argvars, typval_T *rettv); static void f_max(typval_T *argvars, typval_T *rettv); static void f_min(typval_T *argvars, typval_T *rettv); -#ifdef vim_mkdir static void f_mkdir(typval_T *argvars, typval_T *rettv); -#endif static void f_mode(typval_T *argvars, typval_T *rettv); static void f_nextnonblank(typval_T *argvars, typval_T *rettv); static void f_nr2char(typval_T *argvars, typval_T *rettv); @@ -6981,9 +6979,7 @@ static struct fst { {"matchstr", 2, 4, f_matchstr}, {"max", 1, 1, f_max}, {"min", 1, 1, f_min}, -#ifdef vim_mkdir {"mkdir", 1, 3, f_mkdir}, -#endif {"mode", 0, 1, f_mode}, {"nextnonblank", 1, 1, f_nextnonblank}, {"nr2char", 1, 2, f_nr2char}, @@ -11808,7 +11804,6 @@ static int mkdir_recurse(char_u *dir, int prot) return r; } -#ifdef vim_mkdir /* * "mkdir()" function */ @@ -11839,7 +11834,6 @@ static void f_mkdir(typval_T *argvars, typval_T *rettv) rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot); } } -#endif /* * "mode()" function diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 15566ac0cd..4a03b6e283 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7237,12 +7237,10 @@ static void ex_mkrc(exarg_T *eap) else fname = (char_u *)EXRC_FILE; - -#if defined(FEAT_SESSION) && defined(vim_mkdir) /* When using 'viewdir' may have to create the directory. */ - if (using_vdir && !os_isdir(p_vdir)) + if (using_vdir && !os_isdir(p_vdir)) { vim_mkdir_emsg(p_vdir, 0755); -#endif + } fd = open_exfile(fname, eap->forceit, WRITEBIN); if (fd != NULL) { @@ -7360,17 +7358,14 @@ static void ex_mkrc(exarg_T *eap) vim_free(viewFile); } -#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \ - || defined(PROTO) int vim_mkdir_emsg(char_u *name, int prot) { - if (vim_mkdir(name, prot) != 0) { + if (os_mkdir((char *)name, prot) != 0) { EMSG2(_("E739: Cannot create directory: %s"), name); return FAIL; } return OK; } -#endif /* * Open a file for writing for an Ex command, with some checks. diff --git a/src/fileio.c b/src/fileio.c index 396f0a728c..fb9f0e0cea 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5733,7 +5733,7 @@ vim_tempname ( * "repl" has been reported to use "177". */ umask_save = umask(077); # endif - r = vim_mkdir(itmp, 0700); + r = os_mkdir((char *)itmp, 0700); # if defined(UNIX) || defined(VMS) (void)umask(umask_save); # endif diff --git a/src/os_unix_defs.h b/src/os_unix_defs.h index 1e5708da53..9535e1ae12 100644 --- a/src/os_unix_defs.h +++ b/src/os_unix_defs.h @@ -30,8 +30,6 @@ # include <sys/param.h> /* defines BSD, if it's a BSD system */ #endif -#define vim_mkdir(x, y) os_mkdir((char *)(x), (y)) - /* The number of arguments to a signal handler is configured here. */ /* It used to be a long list of almost all systems. Any system that doesn't * have an argument??? */ diff --git a/src/spell.c b/src/spell.c index ea3f0787e3..a8b359166b 100644 --- a/src/spell.c +++ b/src/spell.c @@ -8473,7 +8473,7 @@ spell_add_word ( /* The directory doesn't exist. Try creating it and opening * the file again. */ *p = NUL; - vim_mkdir(fname, 0755); + os_mkdir((char *)fname, 0755); *p = c; fd = mch_fopen((char *)fname, "a"); } @@ -8553,8 +8553,9 @@ static void init_spellfile(void) /* Create the "spell" directory if it doesn't exist yet. */ l = (int)STRLEN(buf); vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell"); - if (os_file_is_writable((char *)buf) != 2) - vim_mkdir(buf, 0755); + if (os_file_is_writable((char *)buf) != 2) { + os_mkdir((char *)buf, 0755); + } l = (int)STRLEN(buf); vim_snprintf((char *)buf + l, MAXPATHL - l, |