Rename buf_modname to modname as they've become the same

This commit is contained in:
Felipe Oliveira Carvalho
2014-04-27 22:15:44 -03:00
committed by Thiago de Arruda
parent 9b56e3a4cc
commit d1411aebd8
4 changed files with 7 additions and 20 deletions

View File

@@ -1569,7 +1569,7 @@ void write_viminfo(char_u *file, int forceit)
#endif #endif
// Make tempname // Make tempname
tempname = buf_modname(fname, (char_u *)".tmp", FALSE); tempname = 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

View File

@@ -3039,7 +3039,7 @@ buf_write (
/* /*
* Make backup file name. * Make backup file name.
*/ */
backup = buf_modname(rootname, backup_ext, FALSE); backup = 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(rootname, backup_ext, FALSE); backup = 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(fname, p_pm, FALSE); char *org = (char *)modname(fname, p_pm, FALSE);
if (backup != NULL) { if (backup != NULL) {
struct stat st; struct stat st;
@@ -4643,16 +4643,6 @@ modname (
char_u *ext, char_u *ext,
int prepend_dot /* may prepend a '.' to file name */ int prepend_dot /* may prepend a '.' to file name */
) )
{
return buf_modname(fname, ext, prepend_dot);
}
char_u *
buf_modname (
char_u *fname,
char_u *ext,
int prepend_dot /* may prepend a '.' to file name */
)
{ {
char_u *retval; char_u *retval;
char_u *s; char_u *s;

View File

@@ -35,7 +35,6 @@ 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(char_u *fname, char_u *ext, 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);

View File

@@ -1610,9 +1610,7 @@ recover_names (
struct stat st; struct stat st;
char_u *swapname; char_u *swapname;
swapname = modname(fname_res, swapname = modname(fname_res, (char_u *)".swp", TRUE);
(char_u *)".swp", TRUE
);
if (swapname != NULL) { if (swapname != NULL) {
if (mch_stat((char *)swapname, &st) != -1) { /* It exists! */ if (mch_stat((char *)swapname, &st) != -1) { /* It exists! */
files = (char_u **)alloc((unsigned)sizeof(char_u *)); files = (char_u **)alloc((unsigned)sizeof(char_u *));
@@ -3372,7 +3370,7 @@ char_u *makeswapname(char_u *fname, char_u *ffname, buf_T *buf, char_u *dir_name
#endif #endif
// Prepend a '.' to the swap file name for the current directory. // Prepend a '.' to the swap file name for the current directory.
r = buf_modname(fname_res, (char_u *)".swp", r = modname(fname_res, (char_u *)".swp",
dir_name[0] == '.' && dir_name[1] == NUL); dir_name[0] == '.' && dir_name[1] == NUL);
if (r == NULL) /* out of memory */ if (r == NULL) /* out of memory */
return NULL; return NULL;