Remove checks for SHORT_FNAME and USE_LONG_FNAME.

They were only defined for MSDOS which is now unsupported.
This commit is contained in:
Chris Watkins 2014-04-23 21:58:08 -07:00 committed by Thiago de Arruda
parent 17d97e725a
commit cb5acb705a
8 changed files with 12 additions and 105 deletions

View File

@ -466,9 +466,7 @@ void buf_clear_file(buf_T *buf)
{
buf->b_ml.ml_line_count = 1;
unchanged(buf, TRUE);
#ifndef SHORT_FNAME
buf->b_shortname = FALSE;
#endif
buf->b_p_eol = TRUE;
buf->b_start_eol = TRUE;
buf->b_p_bomb = FALSE;
@ -2273,9 +2271,6 @@ setfname (
return FAIL;
}
#ifdef USE_FNAME_CASE
# ifdef USE_LONG_FNAME
if (USE_LONG_FNAME)
# endif
fname_case(sfname, 0); /* set correct case for short file name */
#endif
vim_free(buf->b_ffname);
@ -2294,9 +2289,7 @@ setfname (
}
#endif
#ifndef SHORT_FNAME
buf->b_shortname = FALSE;
#endif
buf_name_changed(buf);
return OK;

View File

@ -596,9 +596,7 @@ struct file_buffer {
char_u *b_p_qe; /* 'quoteescape' */
int b_p_ro; /* 'readonly' */
long b_p_sw; /* 'shiftwidth' */
#ifndef SHORT_FNAME
int b_p_sn; /* 'shortname' */
#endif
int b_p_si; /* 'smartindent' */
long b_p_sts; /* 'softtabstop' */
long b_p_sts_nopaste; /* b_p_sts saved for paste mode */
@ -700,9 +698,7 @@ struct file_buffer {
are not used! Use the B_SPELL macro to
access b_spell without #ifdef. */
#ifndef SHORT_FNAME
int b_shortname; /* this file has an 8.3 file name */
#endif
synblock_T b_s; /* Info related to syntax highlighting. w_s
* normally points to this, but some windows

View File

@ -1579,11 +1579,7 @@ void write_viminfo(char_u *file, int forceit)
#ifdef UNIX
shortname,
#else
# ifdef SHORT_FNAME
TRUE,
# else
FALSE,
# endif
#endif
fname,
(char_u *)".tmp",
@ -2659,9 +2655,6 @@ do_ecmd (
if (sfname == NULL)
sfname = ffname;
#ifdef USE_FNAME_CASE
# ifdef USE_LONG_FNAME
if (USE_LONG_FNAME)
# endif
if (sfname != NULL)
fname_case(sfname, 0); /* set correct case for sfname */
#endif

View File

@ -2997,7 +2997,7 @@ buf_write (
struct stat st_new;
char_u *dirp;
char_u *rootname;
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
int did_set_shortname;
#endif
@ -3038,7 +3038,7 @@ buf_write (
goto nobackup;
}
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
did_set_shortname = FALSE;
#endif
@ -3050,11 +3050,7 @@ buf_write (
* Make backup file name.
*/
backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
rootname, backup_ext, FALSE);
if (backup == NULL) {
vim_free(rootname);
@ -3078,7 +3074,6 @@ buf_write (
&& st_new.st_ino == st_old.st_ino) {
vim_free(backup);
backup = NULL; /* no backup file to delete */
# ifndef SHORT_FNAME
/*
* may try again with 'shortname' set
*/
@ -3090,7 +3085,6 @@ buf_write (
/* setting shortname didn't help */
if (did_set_shortname)
buf->b_shortname = FALSE;
# endif
break;
}
#endif
@ -3248,11 +3242,7 @@ nobackup:
backup = NULL;
else {
backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
rootname, backup_ext, FALSE);
vim_free(rootname);
}
@ -3891,11 +3881,7 @@ restore_backup:
*/
if (*p_pm && dobackup) {
char *org = (char *)buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
fname, p_pm, FALSE);
if (backup != NULL) {
@ -4690,11 +4676,7 @@ modname (
)
{
return buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(curbuf->b_p_sn || curbuf->b_shortname),
#endif
fname, ext, prepend_dot);
}
@ -4729,9 +4711,7 @@ buf_modname (
retval[fnamelen++] = PATHSEP;
retval[fnamelen] = NUL;
}
#ifndef SHORT_FNAME
prepend_dot = FALSE; /* nothing to prepend a dot to */
#endif
} else {
fnamelen = (int)STRLEN(fname);
retval = alloc((unsigned)(fnamelen + extlen + 3));
@ -4745,13 +4725,7 @@ buf_modname (
*/
for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) {
if (*ext == '.'
#ifdef USE_LONG_FNAME
&& (!USE_LONG_FNAME || shortname)
#else
# ifndef SHORT_FNAME
&& shortname
# endif
#endif
)
if (*ptr == '.') /* replace '.' by '_' */
*ptr = '_';
@ -4762,23 +4736,15 @@ buf_modname (
}
/* the file name has at most BASENAMELEN characters. */
#ifndef SHORT_FNAME
if (STRLEN(ptr) > (unsigned)BASENAMELEN)
ptr[BASENAMELEN] = '\0';
#endif
s = ptr + STRLEN(ptr);
/*
* For 8.3 file names we may have to reduce the length.
*/
#ifdef USE_LONG_FNAME
if (!USE_LONG_FNAME || shortname)
#else
# ifndef SHORT_FNAME
if (shortname)
# endif
#endif
{
/*
* If there is no file name, or the file name ends in '/', and the
@ -4813,7 +4779,7 @@ buf_modname (
else if ((int)STRLEN(e) + extlen > 4)
s = e + 4 - extlen;
}
#if defined(USE_LONG_FNAME) || defined(WIN3264)
#if defined(WIN3264)
/*
* If there is no file name, and the extension starts with '.', put a
* '_' before the dot, because just ".ext" may be invalid if it's on a
@ -4829,19 +4795,14 @@ buf_modname (
*/
STRCPY(s, ext);
#ifndef SHORT_FNAME
/*
* Prepend the dot.
*/
if (prepend_dot && !shortname && *(e = path_tail(retval)) != '.'
#ifdef USE_LONG_FNAME
&& USE_LONG_FNAME
#endif
) {
STRMOVE(e + 1, e);
*e = '.';
}
#endif
/*
* Check that, after appending the extension, the file name is really

View File

@ -1808,16 +1808,11 @@ static time_t swapfile_info(char_u *fname)
static int recov_file_names(char_u **names, char_u *path, int prepend_dot)
{
int num_names;
#ifdef SHORT_FNAME
names[0] = modname(path, (char_u *)".sw?", FALSE);
num_names = 1;
#else /* !SHORT_FNAME */
/*
* (Win32 and Win64) never short names, but do prepend a dot.
* (Neither Win32 nor Win64) maybe short name, maybe not: Try both.
* Only use the short name if it is different.
*/
/*
* (Win32 and Win64) never short names, but do prepend a dot.
* (Not MS-DOS or Win32 or Win64) maybe short name, maybe not: Try both.
* Only use the short name if it is different.
*/
char_u *p;
int i;
int shortname = curbuf->b_shortname;
@ -1875,7 +1870,6 @@ static int recov_file_names(char_u **names, char_u *path, int prepend_dot)
end:
curbuf->b_shortname = shortname;
#endif /* !SHORT_FNAME */
return num_names;
}
@ -3410,20 +3404,12 @@ char_u *makeswapname(char_u *fname, char_u *ffname, buf_T *buf, char_u *dir_name
#endif
r = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname),
#endif
fname_res,
(char_u *)
".swp",
#ifdef SHORT_FNAME /* always 8.3 file name */
FALSE
#else
/* Prepend a '.' to the swap file name for the current directory. */
dir_name[0] == '.' && dir_name[1] == NUL
#endif
);
if (r == NULL) /* out of memory */
return NULL;
@ -3588,12 +3574,10 @@ findswapname (
char_u *fname;
int n;
char_u *dir_name;
#ifndef SHORT_FNAME
int r;
#endif
char_u *buf_fname = buf->b_fname;
#if !defined(SHORT_FNAME) && !defined(UNIX)
#if !defined(UNIX)
# define CREATE_DUMMY_FILE
FILE *dummyfd = NULL;
@ -3633,7 +3617,7 @@ findswapname (
fname = NULL;
break;
}
#if defined(UNIX) && !defined(SHORT_FNAME)
#if defined(UNIX)
/*
* Some systems have a MS-DOS compatible filesystem that use 8.3 character
* file names. If this is the first try and the swap file name does not fit in
@ -3743,7 +3727,6 @@ findswapname (
* get here when file already exists
*/
if (fname[n - 2] == 'w' && fname[n - 1] == 'p') { /* first try */
#ifndef SHORT_FNAME
/*
* on MS-DOS compatible filesystems (e.g. messydos) file.doc.swp
* and file.doc are the same file. To guess if this problem is
@ -3764,7 +3747,6 @@ findswapname (
continue; /* try again with '.' replaced with '_' */
}
}
#endif
/*
* If we get here the ".swp" file really exists.
* Give an error message, unless recovering, no file name, we are

View File

@ -150,9 +150,7 @@
# define PV_QE OPT_BUF(BV_QE)
#define PV_RO OPT_BUF(BV_RO)
# define PV_SI OPT_BUF(BV_SI)
#ifndef SHORT_FNAME
# define PV_SN OPT_BUF(BV_SN)
#endif
# define PV_SMC OPT_BUF(BV_SMC)
# define PV_SYN OPT_BUF(BV_SYN)
# define PV_SPC OPT_BUF(BV_SPC)
@ -265,9 +263,7 @@ static int p_pi;
static char_u *p_qe;
static int p_ro;
static int p_si;
#ifndef SHORT_FNAME
static int p_sn;
#endif
static long p_sts;
static char_u *p_sua;
static long p_sw;
@ -1419,11 +1415,7 @@ static struct vimoption
{(char_u *)"", (char_u *)"filnxtToO"}
SCRIPTID_INIT},
{"shortname", "sn", P_BOOL|P_VI_DEF,
#ifdef SHORT_FNAME
(char_u *)NULL, PV_NONE,
#else
(char_u *)&p_sn, PV_SN,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL,
(char_u *)&p_sbr, PV_NONE,
@ -6785,9 +6777,7 @@ static char_u *get_varp(struct vimoption *p)
case PV_QE: return (char_u *)&(curbuf->b_p_qe);
case PV_RO: return (char_u *)&(curbuf->b_p_ro);
case PV_SI: return (char_u *)&(curbuf->b_p_si);
#ifndef SHORT_FNAME
case PV_SN: return (char_u *)&(curbuf->b_p_sn);
#endif
case PV_STS: return (char_u *)&(curbuf->b_p_sts);
case PV_SUA: return (char_u *)&(curbuf->b_p_sua);
case PV_SWF: return (char_u *)&(curbuf->b_p_swf);
@ -7013,9 +7003,7 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_ofu = vim_strsave(p_ofu);
buf->b_p_sts = p_sts;
buf->b_p_sts_nopaste = p_sts_nopaste;
#ifndef SHORT_FNAME
buf->b_p_sn = p_sn;
#endif
buf->b_p_com = vim_strsave(p_com);
buf->b_p_cms = vim_strsave(p_cms);
buf->b_p_fo = vim_strsave(p_fo);

View File

@ -691,9 +691,7 @@ enum {
, BV_QE
, BV_RO
, BV_SI
#ifndef SHORT_FNAME
, BV_SN
#endif
, BV_SMC
, BV_SYN
, BV_SPC

View File

@ -1568,12 +1568,8 @@ char_u *fix_fname(char_u *fname)
fname = vim_strsave(fname);
# ifdef USE_FNAME_CASE
# ifdef USE_LONG_FNAME
if (USE_LONG_FNAME)
# endif
{
if (fname != NULL)
fname_case(fname, 0); /* set correct case for file name */
if (fname != NULL) {
fname_case(fname, 0); /* set correct case for file name */
}
# endif