mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 14:28:18 +00:00
removed vim_mkdir macro
This commit is contained in:

committed by
Thiago de Arruda

parent
96ddc0198d
commit
c1961ee0df
@@ -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_matchstr(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_max(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);
|
static void f_min(typval_T *argvars, typval_T *rettv);
|
||||||
#ifdef vim_mkdir
|
|
||||||
static void f_mkdir(typval_T *argvars, typval_T *rettv);
|
static void f_mkdir(typval_T *argvars, typval_T *rettv);
|
||||||
#endif
|
|
||||||
static void f_mode(typval_T *argvars, typval_T *rettv);
|
static void f_mode(typval_T *argvars, typval_T *rettv);
|
||||||
static void f_nextnonblank(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);
|
static void f_nr2char(typval_T *argvars, typval_T *rettv);
|
||||||
@@ -6981,9 +6979,7 @@ static struct fst {
|
|||||||
{"matchstr", 2, 4, f_matchstr},
|
{"matchstr", 2, 4, f_matchstr},
|
||||||
{"max", 1, 1, f_max},
|
{"max", 1, 1, f_max},
|
||||||
{"min", 1, 1, f_min},
|
{"min", 1, 1, f_min},
|
||||||
#ifdef vim_mkdir
|
|
||||||
{"mkdir", 1, 3, f_mkdir},
|
{"mkdir", 1, 3, f_mkdir},
|
||||||
#endif
|
|
||||||
{"mode", 0, 1, f_mode},
|
{"mode", 0, 1, f_mode},
|
||||||
{"nextnonblank", 1, 1, f_nextnonblank},
|
{"nextnonblank", 1, 1, f_nextnonblank},
|
||||||
{"nr2char", 1, 2, f_nr2char},
|
{"nr2char", 1, 2, f_nr2char},
|
||||||
@@ -11808,7 +11804,6 @@ static int mkdir_recurse(char_u *dir, int prot)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef vim_mkdir
|
|
||||||
/*
|
/*
|
||||||
* "mkdir()" function
|
* "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);
|
rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "mode()" function
|
* "mode()" function
|
||||||
|
@@ -7237,12 +7237,10 @@ static void ex_mkrc(exarg_T *eap)
|
|||||||
else
|
else
|
||||||
fname = (char_u *)EXRC_FILE;
|
fname = (char_u *)EXRC_FILE;
|
||||||
|
|
||||||
|
|
||||||
#if defined(FEAT_SESSION) && defined(vim_mkdir)
|
|
||||||
/* When using 'viewdir' may have to create the directory. */
|
/* 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);
|
vim_mkdir_emsg(p_vdir, 0755);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
fd = open_exfile(fname, eap->forceit, WRITEBIN);
|
fd = open_exfile(fname, eap->forceit, WRITEBIN);
|
||||||
if (fd != NULL) {
|
if (fd != NULL) {
|
||||||
@@ -7360,17 +7358,14 @@ static void ex_mkrc(exarg_T *eap)
|
|||||||
vim_free(viewFile);
|
vim_free(viewFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
|
|
||||||
|| defined(PROTO)
|
|
||||||
int vim_mkdir_emsg(char_u *name, int prot)
|
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);
|
EMSG2(_("E739: Cannot create directory: %s"), name);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open a file for writing for an Ex command, with some checks.
|
* Open a file for writing for an Ex command, with some checks.
|
||||||
|
@@ -5733,7 +5733,7 @@ vim_tempname (
|
|||||||
* "repl" has been reported to use "177". */
|
* "repl" has been reported to use "177". */
|
||||||
umask_save = umask(077);
|
umask_save = umask(077);
|
||||||
# endif
|
# endif
|
||||||
r = vim_mkdir(itmp, 0700);
|
r = os_mkdir((char *)itmp, 0700);
|
||||||
# if defined(UNIX) || defined(VMS)
|
# if defined(UNIX) || defined(VMS)
|
||||||
(void)umask(umask_save);
|
(void)umask(umask_save);
|
||||||
# endif
|
# endif
|
||||||
|
@@ -30,8 +30,6 @@
|
|||||||
# include <sys/param.h> /* defines BSD, if it's a BSD system */
|
# include <sys/param.h> /* defines BSD, if it's a BSD system */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define vim_mkdir(x, y) os_mkdir((char *)(x), (y))
|
|
||||||
|
|
||||||
/* The number of arguments to a signal handler is configured here. */
|
/* 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
|
/* It used to be a long list of almost all systems. Any system that doesn't
|
||||||
* have an argument??? */
|
* have an argument??? */
|
||||||
|
@@ -8473,7 +8473,7 @@ spell_add_word (
|
|||||||
/* The directory doesn't exist. Try creating it and opening
|
/* The directory doesn't exist. Try creating it and opening
|
||||||
* the file again. */
|
* the file again. */
|
||||||
*p = NUL;
|
*p = NUL;
|
||||||
vim_mkdir(fname, 0755);
|
os_mkdir((char *)fname, 0755);
|
||||||
*p = c;
|
*p = c;
|
||||||
fd = mch_fopen((char *)fname, "a");
|
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. */
|
/* Create the "spell" directory if it doesn't exist yet. */
|
||||||
l = (int)STRLEN(buf);
|
l = (int)STRLEN(buf);
|
||||||
vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell");
|
vim_snprintf((char *)buf + l, MAXPATHL - l, "/spell");
|
||||||
if (os_file_is_writable((char *)buf) != 2)
|
if (os_file_is_writable((char *)buf) != 2) {
|
||||||
vim_mkdir(buf, 0755);
|
os_mkdir((char *)buf, 0755);
|
||||||
|
}
|
||||||
|
|
||||||
l = (int)STRLEN(buf);
|
l = (int)STRLEN(buf);
|
||||||
vim_snprintf((char *)buf + l, MAXPATHL - l,
|
vim_snprintf((char *)buf + l, MAXPATHL - l,
|
||||||
|
Reference in New Issue
Block a user