From da2423c5287ebcc0e2018562ddd61d9becfe1c6b Mon Sep 17 00:00:00 2001 From: warwick Date: Thu, 4 Jul 2002 06:23:42 +0000 Subject: [PATCH] Linux and SVR4 don'thave 14-character filename limits. Re-factor the #defines while I'm at it. --- sys/unix/unixunix.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sys/unix/unixunix.c b/sys/unix/unixunix.c index bb45f3639..df8caec83 100644 --- a/sys/unix/unixunix.c +++ b/sys/unix/unixunix.c @@ -194,24 +194,23 @@ regularize(s) /* normalize file name - we don't like .'s, /'s, spaces */ register char *s; { register char *lp; -#if defined(SYSV) && !defined(AIX_31) && defined(COMPRESS) - int i; -#endif while((lp=index(s, '.')) || (lp=index(s, '/')) || (lp=index(s,' '))) *lp = '_'; -#if defined(SYSV) && !defined(AIX_31) +#if defined(SYSV) && !defined(AIX_31) && !defined(SVR4) && !defined(LINUX) /* avoid problems with 14 character file name limit */ # ifdef COMPRESS /* leave room for .e from error and .Z from compress appended to * save files */ + { # ifdef COMPRESS_EXTENSION - i = 12 - strlen(COMPRESS_EXTENSION); + int i = 12 - strlen(COMPRESS_EXTENSION); # else - i = 10; /* should never happen... */ + int i = 10; /* should never happen... */ # endif - if(strlen(s) > i) + if(strlen(s) > i) s[i] = '\0'; + } # else if(strlen(s) > 11) /* leave room for .nn appended to level files */