mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 15:38:33 +00:00
Remove the always-FALSE shortname argument from buf_modname()
This commit is contained in:

committed by
Thiago de Arruda

parent
89e07185e9
commit
9b56e3a4cc
@@ -1569,7 +1569,7 @@ void write_viminfo(char_u *file, int forceit)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make tempname
|
// Make tempname
|
||||||
tempname = buf_modname(FALSE, fname, (char_u *)".tmp", FALSE);
|
tempname = buf_modname(fname, (char_u *)".tmp", FALSE);
|
||||||
if (tempname != NULL) {
|
if (tempname != NULL) {
|
||||||
/*
|
/*
|
||||||
* Check if tempfile already exists. Never overwrite an
|
* Check if tempfile already exists. Never overwrite an
|
||||||
|
11
src/fileio.c
11
src/fileio.c
@@ -3039,7 +3039,7 @@ buf_write (
|
|||||||
/*
|
/*
|
||||||
* Make backup file name.
|
* Make backup file name.
|
||||||
*/
|
*/
|
||||||
backup = buf_modname(FALSE, rootname, backup_ext, FALSE);
|
backup = buf_modname(rootname, backup_ext, FALSE);
|
||||||
if (backup == NULL) {
|
if (backup == NULL) {
|
||||||
vim_free(rootname);
|
vim_free(rootname);
|
||||||
some_error = TRUE; /* out of memory */
|
some_error = TRUE; /* out of memory */
|
||||||
@@ -3215,7 +3215,7 @@ nobackup:
|
|||||||
if (rootname == NULL)
|
if (rootname == NULL)
|
||||||
backup = NULL;
|
backup = NULL;
|
||||||
else {
|
else {
|
||||||
backup = buf_modname(FALSE, rootname, backup_ext, FALSE);
|
backup = buf_modname(rootname, backup_ext, FALSE);
|
||||||
vim_free(rootname);
|
vim_free(rootname);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3852,7 +3852,7 @@ restore_backup:
|
|||||||
* the backup file our 'original' file.
|
* the backup file our 'original' file.
|
||||||
*/
|
*/
|
||||||
if (*p_pm && dobackup) {
|
if (*p_pm && dobackup) {
|
||||||
char *org = (char *)buf_modname(FALSE, fname, p_pm, FALSE);
|
char *org = (char *)buf_modname(fname, p_pm, FALSE);
|
||||||
|
|
||||||
if (backup != NULL) {
|
if (backup != NULL) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@@ -4644,12 +4644,11 @@ modname (
|
|||||||
int prepend_dot /* may prepend a '.' to file name */
|
int prepend_dot /* may prepend a '.' to file name */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return buf_modname(FALSE, fname, ext, prepend_dot);
|
return buf_modname(fname, ext, prepend_dot);
|
||||||
}
|
}
|
||||||
|
|
||||||
char_u *
|
char_u *
|
||||||
buf_modname (
|
buf_modname (
|
||||||
int shortname, // use 8.3 file name, should always be FALSE now
|
|
||||||
char_u *fname,
|
char_u *fname,
|
||||||
char_u *ext,
|
char_u *ext,
|
||||||
int prepend_dot /* may prepend a '.' to file name */
|
int prepend_dot /* may prepend a '.' to file name */
|
||||||
@@ -4663,8 +4662,6 @@ buf_modname (
|
|||||||
|
|
||||||
extlen = (int)STRLEN(ext);
|
extlen = (int)STRLEN(ext);
|
||||||
|
|
||||||
assert(!shortname);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is no file name we must get the name of the current directory
|
* If there is no file name we must get the name of the current directory
|
||||||
* (we need the full path in case :cd is used).
|
* (we need the full path in case :cd is used).
|
||||||
|
@@ -35,8 +35,7 @@ void msg_add_fname(buf_T *buf, char_u *fname);
|
|||||||
void msg_add_lines(int insert_space, long lnum, off_t nchars);
|
void msg_add_lines(int insert_space, long lnum, off_t nchars);
|
||||||
void shorten_fnames(int force);
|
void shorten_fnames(int force);
|
||||||
char_u *modname(char_u *fname, char_u *ext, int prepend_dot);
|
char_u *modname(char_u *fname, char_u *ext, int prepend_dot);
|
||||||
char_u *buf_modname(int shortname, char_u *fname, char_u *ext,
|
char_u *buf_modname(char_u *fname, char_u *ext, int prepend_dot);
|
||||||
int prepend_dot);
|
|
||||||
int vim_fgets(char_u *buf, int size, FILE *fp);
|
int vim_fgets(char_u *buf, int size, FILE *fp);
|
||||||
int tag_fgets(char_u *buf, int size, FILE *fp);
|
int tag_fgets(char_u *buf, int size, FILE *fp);
|
||||||
int vim_rename(char_u *from, char_u *to);
|
int vim_rename(char_u *from, char_u *to);
|
||||||
|
@@ -3371,14 +3371,9 @@ char_u *makeswapname(char_u *fname, char_u *ffname, buf_T *buf, char_u *dir_name
|
|||||||
fname_res = fname_buf;
|
fname_res = fname_buf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
r = buf_modname(
|
// Prepend a '.' to the swap file name for the current directory.
|
||||||
FALSE,
|
r = buf_modname(fname_res, (char_u *)".swp",
|
||||||
fname_res,
|
dir_name[0] == '.' && dir_name[1] == NUL);
|
||||||
(char_u *)
|
|
||||||
".swp",
|
|
||||||
/* Prepend a '.' to the swap file name for the current directory. */
|
|
||||||
dir_name[0] == '.' && dir_name[1] == NUL
|
|
||||||
);
|
|
||||||
if (r == NULL) /* out of memory */
|
if (r == NULL) /* out of memory */
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user