]> granicus.if.org Git - nethack/commitdiff
Turn "_" into " ", since "Brave_Sir_Robin" looks yucky.
authorwarwick <warwick>
Thu, 4 Jul 2002 06:26:15 +0000 (06:26 +0000)
committerwarwick <warwick>
Thu, 4 Jul 2002 06:26:15 +0000 (06:26 +0000)
Proper fix is to store name in file.

win/Qt/qt_win.cpp

index 4a56041fdd42504960f90a4e291de80be5400b9e..97b436c81787db6ed40e9c32c77bd49cda6d56ee 100644 (file)
@@ -4476,9 +4476,17 @@ static char** get_saved_names()
            char name[NAME_MAX];
            if ( sscanf( namelist[i]->d_name, "%d%s", &uid, name ) == 2 ) {
                if ( uid == myuid ) {
+                   /* Name should be stored in save file, but currently we
+                       have to extract it from the filename, which loses
+                       information (eg. "/", "_", and "." characters are lost. */
+                   int k;
                    char* end = strstr(name,".gz");
                    if ( !end ) end = strstr(name,".Z");
                    if ( end ) *end = 0;
+                   /* "_" most likely means " ", which certainly looks nicer */
+                   for (k=0; name[k]; k++)
+                       if ( name[k]=='_' )
+                           name[k]=' ';
                    result[j++] = strdup(name);
                }
            }