Skip to content

Commit

Permalink
Clean up a gcc warning about an assignment to a const string.
Browse files Browse the repository at this point in the history
[[originally from CVS; cvs2svn created svn r1039]]
  • Loading branch information
Trent Piepho committed Feb 16, 1999
1 parent c110663 commit fadf97e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,14 @@ char *datafilename(char *filename)
static const char* datadir=0;
static char realfile[512];
if(!datadir) {
if((datadir = getenv("FREECIV_DATADIR"))) {
char *tmp;
if((tmp = getenv("FREECIV_DATADIR"))) {
int i;
for(i=strlen(datadir)-1; i>=0 && isspace((int)datadir[i]); i--)
datadir[i] = '\0';
if(datadir[i] == '/')
datadir[i] = '\0';
tmp[i] = '\0';
if(tmp[i] == '/')
tmp[i] = '\0';
datadir = tmp;
} else {
datadir = FREECIV_DATADIR; /* correct if not 'data' is the default */
};
Expand Down

0 comments on commit fadf97e

Please sign in to comment.