p = copybuf + STRLEN(copybuf);
if (after_pathsep(copybuf, p) && p[-1] == p[-2])
// Ends with '//', use full path
- if ((p = make_percent_swname(copybuf, fname)) != NULL)
+ if ((p = make_percent_swname(copybuf, p, fname)) != NULL)
{
backup = modname(p, backup_ext, FALSE);
vim_free(p);
p = IObuff + STRLEN(IObuff);
if (after_pathsep(IObuff, p) && p[-1] == p[-2])
// path ends with '//', use full path
- if ((p = make_percent_swname(IObuff, fname)) != NULL)
+ if ((p = make_percent_swname(IObuff, p, fname)) != NULL)
{
backup = modname(p, backup_ext, FALSE);
vim_free(p);
if (after_pathsep(dir_name, p) && len > 1 && p[-1] == p[-2])
{
// Ends with '//', Use Full path for swap name
- tail = make_percent_swname(dir_name, fname_res);
+ tail = make_percent_swname(dir_name, p, fname_res);
}
else
#endif
* removed.
*/
char_u *
-make_percent_swname(char_u *dir, char_u *name)
+make_percent_swname(char_u *dir, char_u *dir_end, char_u *name)
{
char_u *d = NULL, *s, *f;
if (vim_ispathsep(*d))
*d = '%';
- dir[STRLEN(dir) - 1] = NUL; // remove one trailing slash
+ dir_end[-1] = NUL; // remove one trailing slash
d = concat_fnames(dir, s, TRUE);
vim_free(s);
}
if (after_pathsep(dir_name, s) && len > 1 && s[-1] == s[-2])
{ // Ends with '//', Use Full path
r = NULL;
- if ((s = make_percent_swname(dir_name, fname_res)) != NULL)
+ if ((s = make_percent_swname(dir_name, s, fname_res)) != NULL)
{
r = modname(s, (char_u *)".swp", FALSE);
vim_free(s);
void ml_timestamp(buf_T *buf);
void ml_recover(int checkext);
int recover_names(char_u *fname, int do_list, list_T *ret_list, int nr, char_u **fname_out);
-char_u *make_percent_swname(char_u *dir, char_u *name);
+char_u *make_percent_swname(char_u *dir, char_u *dir_end, char_u *name);
void get_b0_dict(char_u *fname, dict_T *d);
void ml_sync_all(int check_file, int check_char);
void ml_preserve(buf_T *buf, int message);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 615,
/**/
614,
/**/