Skip to content

Commit

Permalink
Reverted to cvs revision 1.8, since 1.9 was checked in by mistake,
Browse files Browse the repository at this point in the history
and the 1.10 fix caused segfault if FREECIV_DATADIR is set.

[[originally from CVS; cvs2svn created svn r1040]]
  • Loading branch information
David Pfitzner committed Feb 16, 1999
1 parent fadf97e commit fd56cef
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions common/shared.c
Expand Up @@ -356,17 +356,15 @@ only supply one filename at a time.
***************************************************************************/
char *datafilename(char *filename)
{
static const char* datadir=0;
static char* datadir=0;
static char realfile[512];
if(!datadir) {
char *tmp;
if((tmp = getenv("FREECIV_DATADIR"))) {
if((datadir = getenv("FREECIV_DATADIR"))) {
int i;
for(i=strlen(datadir)-1; i>=0 && isspace((int)datadir[i]); i--)
tmp[i] = '\0';
if(tmp[i] == '/')
tmp[i] = '\0';
datadir = tmp;
datadir[i] = '\0';
if(datadir[i] == '/')
datadir[i] = '\0';
} else {
datadir = FREECIV_DATADIR; /* correct if not 'data' is the default */
};
Expand Down

0 comments on commit fd56cef

Please sign in to comment.