unix.c
changeset 2940 ce57a148333e
parent 2736 1ea068235989
child 2952 6a26eeda9679
child 9948 877dccfeb22e
--- a/unix.c	Tue Jan 31 06:53:32 2006 +0000
+++ b/unix.c	Tue Jan 31 12:08:49 2006 +0000
@@ -121,6 +121,7 @@
 				ttd_strlcpy(fios->name, dirent->d_name, lengthof(fios->name));
 				snprintf(fios->title, lengthof(fios->title),
 					"%s/ (Directory)", dirent->d_name);
+				str_validate(fios->title);
 			}
 		}
 		closedir(dir);
@@ -163,6 +164,7 @@
 
 				*t = '\0'; // strip extension
 				ttd_strlcpy(fios->title, dirent->d_name, lengthof(fios->title));
+				str_validate(fios->title);
 			} else if (mode == SLD_LOAD_GAME || mode == SLD_LOAD_SCENARIO) {
 				if (strcasecmp(t, ".ss1") == 0 ||
 						strcasecmp(t, ".sv1") == 0 ||
@@ -222,6 +224,7 @@
 				fios->mtime = 0;
 				ttd_strlcpy(fios->name, dirent->d_name, lengthof(fios->name));
 				snprintf(fios->title, lengthof(fios->title), "%s/ (Directory)", dirent->d_name);
+				str_validate(fios->title);
 			}
 		}
 		closedir(dir);
@@ -262,6 +265,7 @@
 
 				*t = '\0'; // strip extension
 				ttd_strlcpy(fios->title, dirent->d_name, lengthof(fios->title));
+				str_validate(fios->title);
 			} else if (mode == SLD_LOAD_GAME || mode == SLD_LOAD_SCENARIO ||
 					mode == SLD_NEW_GAME) {
 				if (strcasecmp(t, ".sv0") == 0 ||