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

View File

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

View File

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

View File

@ -2997,7 +2997,7 @@ buf_write (
struct stat st_new; struct stat st_new;
char_u *dirp; char_u *dirp;
char_u *rootname; char_u *rootname;
#if defined(UNIX) && !defined(SHORT_FNAME) #if defined(UNIX)
int did_set_shortname; int did_set_shortname;
#endif #endif
@ -3038,7 +3038,7 @@ buf_write (
goto nobackup; goto nobackup;
} }
#if defined(UNIX) && !defined(SHORT_FNAME) #if defined(UNIX)
did_set_shortname = FALSE; did_set_shortname = FALSE;
#endif #endif
@ -3050,11 +3050,7 @@ buf_write (
* Make backup file name. * Make backup file name.
*/ */
backup = buf_modname( backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname), (buf->b_p_sn || buf->b_shortname),
#endif
rootname, backup_ext, FALSE); rootname, backup_ext, FALSE);
if (backup == NULL) { if (backup == NULL) {
vim_free(rootname); vim_free(rootname);
@ -3078,7 +3074,6 @@ buf_write (
&& st_new.st_ino == st_old.st_ino) { && st_new.st_ino == st_old.st_ino) {
vim_free(backup); vim_free(backup);
backup = NULL; /* no backup file to delete */ backup = NULL; /* no backup file to delete */
# ifndef SHORT_FNAME
/* /*
* may try again with 'shortname' set * may try again with 'shortname' set
*/ */
@ -3090,7 +3085,6 @@ buf_write (
/* setting shortname didn't help */ /* setting shortname didn't help */
if (did_set_shortname) if (did_set_shortname)
buf->b_shortname = FALSE; buf->b_shortname = FALSE;
# endif
break; break;
} }
#endif #endif
@ -3248,11 +3242,7 @@ nobackup:
backup = NULL; backup = NULL;
else { else {
backup = buf_modname( backup = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname), (buf->b_p_sn || buf->b_shortname),
#endif
rootname, backup_ext, FALSE); rootname, backup_ext, FALSE);
vim_free(rootname); vim_free(rootname);
} }
@ -3891,11 +3881,7 @@ restore_backup:
*/ */
if (*p_pm && dobackup) { if (*p_pm && dobackup) {
char *org = (char *)buf_modname( char *org = (char *)buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname), (buf->b_p_sn || buf->b_shortname),
#endif
fname, p_pm, FALSE); fname, p_pm, FALSE);
if (backup != NULL) { if (backup != NULL) {
@ -4690,11 +4676,7 @@ modname (
) )
{ {
return buf_modname( return buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(curbuf->b_p_sn || curbuf->b_shortname), (curbuf->b_p_sn || curbuf->b_shortname),
#endif
fname, ext, prepend_dot); fname, ext, prepend_dot);
} }
@ -4729,9 +4711,7 @@ buf_modname (
retval[fnamelen++] = PATHSEP; retval[fnamelen++] = PATHSEP;
retval[fnamelen] = NUL; retval[fnamelen] = NUL;
} }
#ifndef SHORT_FNAME
prepend_dot = FALSE; /* nothing to prepend a dot to */ prepend_dot = FALSE; /* nothing to prepend a dot to */
#endif
} else { } else {
fnamelen = (int)STRLEN(fname); fnamelen = (int)STRLEN(fname);
retval = alloc((unsigned)(fnamelen + extlen + 3)); retval = alloc((unsigned)(fnamelen + extlen + 3));
@ -4745,13 +4725,7 @@ buf_modname (
*/ */
for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) { for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) {
if (*ext == '.' if (*ext == '.'
#ifdef USE_LONG_FNAME
&& (!USE_LONG_FNAME || shortname)
#else
# ifndef SHORT_FNAME
&& shortname && shortname
# endif
#endif
) )
if (*ptr == '.') /* replace '.' by '_' */ if (*ptr == '.') /* replace '.' by '_' */
*ptr = '_'; *ptr = '_';
@ -4762,23 +4736,15 @@ buf_modname (
} }
/* the file name has at most BASENAMELEN characters. */ /* the file name has at most BASENAMELEN characters. */
#ifndef SHORT_FNAME
if (STRLEN(ptr) > (unsigned)BASENAMELEN) if (STRLEN(ptr) > (unsigned)BASENAMELEN)
ptr[BASENAMELEN] = '\0'; ptr[BASENAMELEN] = '\0';
#endif
s = ptr + STRLEN(ptr); s = ptr + STRLEN(ptr);
/* /*
* For 8.3 file names we may have to reduce the length. * 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) if (shortname)
# endif
#endif
{ {
/* /*
* If there is no file name, or the file name ends in '/', and the * 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) else if ((int)STRLEN(e) + extlen > 4)
s = e + 4 - extlen; 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 * 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 * '_' before the dot, because just ".ext" may be invalid if it's on a
@ -4829,19 +4795,14 @@ buf_modname (
*/ */
STRCPY(s, ext); STRCPY(s, ext);
#ifndef SHORT_FNAME
/* /*
* Prepend the dot. * Prepend the dot.
*/ */
if (prepend_dot && !shortname && *(e = path_tail(retval)) != '.' if (prepend_dot && !shortname && *(e = path_tail(retval)) != '.'
#ifdef USE_LONG_FNAME
&& USE_LONG_FNAME
#endif
) { ) {
STRMOVE(e + 1, e); STRMOVE(e + 1, e);
*e = '.'; *e = '.';
} }
#endif
/* /*
* Check that, after appending the extension, the file name is really * 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) static int recov_file_names(char_u **names, char_u *path, int prepend_dot)
{ {
int num_names; int num_names;
/*
#ifdef SHORT_FNAME * (Win32 and Win64) never short names, but do prepend a dot.
names[0] = modname(path, (char_u *)".sw?", FALSE); * (Not MS-DOS or Win32 or Win64) maybe short name, maybe not: Try both.
num_names = 1; * Only use the short name if it is different.
#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.
*/
char_u *p; char_u *p;
int i; int i;
int shortname = curbuf->b_shortname; int shortname = curbuf->b_shortname;
@ -1875,7 +1870,6 @@ static int recov_file_names(char_u **names, char_u *path, int prepend_dot)
end: end:
curbuf->b_shortname = shortname; curbuf->b_shortname = shortname;
#endif /* !SHORT_FNAME */
return num_names; return num_names;
} }
@ -3410,20 +3404,12 @@ char_u *makeswapname(char_u *fname, char_u *ffname, buf_T *buf, char_u *dir_name
#endif #endif
r = buf_modname( r = buf_modname(
#ifdef SHORT_FNAME
TRUE,
#else
(buf->b_p_sn || buf->b_shortname), (buf->b_p_sn || buf->b_shortname),
#endif
fname_res, fname_res,
(char_u *) (char_u *)
".swp", ".swp",
#ifdef SHORT_FNAME /* always 8.3 file name */
FALSE
#else
/* Prepend a '.' to the swap file name for the current directory. */ /* Prepend a '.' to the swap file name for the current directory. */
dir_name[0] == '.' && dir_name[1] == NUL dir_name[0] == '.' && dir_name[1] == NUL
#endif
); );
if (r == NULL) /* out of memory */ if (r == NULL) /* out of memory */
return NULL; return NULL;
@ -3588,12 +3574,10 @@ findswapname (
char_u *fname; char_u *fname;
int n; int n;
char_u *dir_name; char_u *dir_name;
#ifndef SHORT_FNAME
int r; int r;
#endif
char_u *buf_fname = buf->b_fname; char_u *buf_fname = buf->b_fname;
#if !defined(SHORT_FNAME) && !defined(UNIX) #if !defined(UNIX)
# define CREATE_DUMMY_FILE # define CREATE_DUMMY_FILE
FILE *dummyfd = NULL; FILE *dummyfd = NULL;
@ -3633,7 +3617,7 @@ findswapname (
fname = NULL; fname = NULL;
break; break;
} }
#if defined(UNIX) && !defined(SHORT_FNAME) #if defined(UNIX)
/* /*
* Some systems have a MS-DOS compatible filesystem that use 8.3 character * 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 * 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 * get here when file already exists
*/ */
if (fname[n - 2] == 'w' && fname[n - 1] == 'p') { /* first try */ 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 * on MS-DOS compatible filesystems (e.g. messydos) file.doc.swp
* and file.doc are the same file. To guess if this problem is * and file.doc are the same file. To guess if this problem is
@ -3764,7 +3747,6 @@ findswapname (
continue; /* try again with '.' replaced with '_' */ continue; /* try again with '.' replaced with '_' */
} }
} }
#endif
/* /*
* If we get here the ".swp" file really exists. * If we get here the ".swp" file really exists.
* Give an error message, unless recovering, no file name, we are * 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_QE OPT_BUF(BV_QE)
#define PV_RO OPT_BUF(BV_RO) #define PV_RO OPT_BUF(BV_RO)
# define PV_SI OPT_BUF(BV_SI) # define PV_SI OPT_BUF(BV_SI)
#ifndef SHORT_FNAME
# define PV_SN OPT_BUF(BV_SN) # define PV_SN OPT_BUF(BV_SN)
#endif
# define PV_SMC OPT_BUF(BV_SMC) # define PV_SMC OPT_BUF(BV_SMC)
# define PV_SYN OPT_BUF(BV_SYN) # define PV_SYN OPT_BUF(BV_SYN)
# define PV_SPC OPT_BUF(BV_SPC) # define PV_SPC OPT_BUF(BV_SPC)
@ -265,9 +263,7 @@ static int p_pi;
static char_u *p_qe; static char_u *p_qe;
static int p_ro; static int p_ro;
static int p_si; static int p_si;
#ifndef SHORT_FNAME
static int p_sn; static int p_sn;
#endif
static long p_sts; static long p_sts;
static char_u *p_sua; static char_u *p_sua;
static long p_sw; static long p_sw;
@ -1419,11 +1415,7 @@ static struct vimoption
{(char_u *)"", (char_u *)"filnxtToO"} {(char_u *)"", (char_u *)"filnxtToO"}
SCRIPTID_INIT}, SCRIPTID_INIT},
{"shortname", "sn", P_BOOL|P_VI_DEF, {"shortname", "sn", P_BOOL|P_VI_DEF,
#ifdef SHORT_FNAME
(char_u *)NULL, PV_NONE,
#else
(char_u *)&p_sn, PV_SN, (char_u *)&p_sn, PV_SN,
#endif
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL, {"showbreak", "sbr", P_STRING|P_VI_DEF|P_RALL,
(char_u *)&p_sbr, PV_NONE, (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_QE: return (char_u *)&(curbuf->b_p_qe);
case PV_RO: return (char_u *)&(curbuf->b_p_ro); case PV_RO: return (char_u *)&(curbuf->b_p_ro);
case PV_SI: return (char_u *)&(curbuf->b_p_si); case PV_SI: return (char_u *)&(curbuf->b_p_si);
#ifndef SHORT_FNAME
case PV_SN: return (char_u *)&(curbuf->b_p_sn); case PV_SN: return (char_u *)&(curbuf->b_p_sn);
#endif
case PV_STS: return (char_u *)&(curbuf->b_p_sts); case PV_STS: return (char_u *)&(curbuf->b_p_sts);
case PV_SUA: return (char_u *)&(curbuf->b_p_sua); case PV_SUA: return (char_u *)&(curbuf->b_p_sua);
case PV_SWF: return (char_u *)&(curbuf->b_p_swf); 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_ofu = vim_strsave(p_ofu);
buf->b_p_sts = p_sts; buf->b_p_sts = p_sts;
buf->b_p_sts_nopaste = p_sts_nopaste; buf->b_p_sts_nopaste = p_sts_nopaste;
#ifndef SHORT_FNAME
buf->b_p_sn = p_sn; buf->b_p_sn = p_sn;
#endif
buf->b_p_com = vim_strsave(p_com); buf->b_p_com = vim_strsave(p_com);
buf->b_p_cms = vim_strsave(p_cms); buf->b_p_cms = vim_strsave(p_cms);
buf->b_p_fo = vim_strsave(p_fo); buf->b_p_fo = vim_strsave(p_fo);

View File

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

View File

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