diff -Nurd -Xfreeciv/diff_ignore freeciv-may23/common/ioz.c freeciv-may23+save2new/common/ioz.c --- freeciv-may23/common/ioz.c Fri May 24 08:26:49 2002 +++ freeciv-may23+save2new/common/ioz.c Sat May 25 02:00:40 2002 @@ -74,7 +74,7 @@ fz_FILE *fp; char mode[64]; - if (!is_reg_file(filename)) { + if (!isnt_irreg_file(filename)) { return NULL; } diff -Nurd -Xfreeciv/diff_ignore freeciv-may23/common/support.c freeciv-may23+save2new/common/support.c --- freeciv-may23/common/support.c Fri May 24 08:26:50 2002 +++ freeciv-may23+save2new/common/support.c Sat May 25 02:43:25 2002 @@ -486,3 +486,14 @@ return stat(name, &tmp) == 0 && S_ISREG(tmp.st_mode); } + +/********************************************************************** + Returns TRUE iff the file is a regular file or a link to a regular + dile, or doesn't exist. +***********************************************************************/ +bool isnt_irreg_file(const char *name) +{ + struct stat tmp; + + return stat(name, &tmp) == 0 ? S_ISREG(tmp.st_mode) : errno == ENOENT; +} diff -Nurd -Xfreeciv/diff_ignore freeciv-may23/common/support.h freeciv-may23+save2new/common/support.h --- freeciv-may23/common/support.h Fri May 24 08:26:50 2002 +++ freeciv-may23+save2new/common/support.h Sat May 25 02:00:09 2002 @@ -57,5 +57,6 @@ #endif bool is_reg_file(const char *name); +bool isnt_irreg_file(const char *name); #endif /* FC__SUPPORT_H */ diff -Nurd -Xfreeciv/diff_ignore freeciv-may23/server/stdinhand.c freeciv-may23+save2new/server/stdinhand.c --- freeciv-may23/server/stdinhand.c Fri May 24 08:27:11 2002 +++ freeciv-may23+save2new/server/stdinhand.c Sat May 25 02:02:15 2002 @@ -1817,9 +1817,8 @@ { FILE *script_file; - script_file = fopen(script_filename,"w"); - - if (script_file) { + if (isnt_irreg_file(script_filename) + && (script_file = fopen(script_filename, "w"))) { int i;