Remove commented out demo_rename_player body
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Mon, 1 Nov 2010 13:40:40 +0000 (13:40 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Mon, 1 Nov 2010 13:40:40 +0000 (13:40 +0000)
git-svn-id: https://s.snth.net/svn/neverball/trunk@3345 78b8d119-cf0a-0410-b17c-f493084dd1d7

ball/demo.c

index 99884d0..3076a8e 100644 (file)
@@ -356,74 +356,8 @@ void demo_rename(const char *name)
 
 void demo_rename_player(const char *name, const char *player)
 {
-#if 0
-    char filename[MAXSTR];
-    FILE *old_fp, *new_fp;
-    struct demo d;
-
-    assert(name);
-    assert(player);
-
-    /* TODO: make this reusable. */
-
-    filename[sizeof (filename) - 1] = '\0';
-    strncpy(filename, name, sizeof (filename) - 1);
-    strncat(filename, REPLAY_EXT, sizeof (filename) - 1 - strlen(name));
-
-    /*
-     * Write out a temporary file containing the original replay data with a
-     * new player name, then copy the resulting contents back to the original
-     * file.
-     *
-     * (It is believed that the ugliness found here is outweighed by the
-     * benefits of preserving the arbitrary-length property of all strings in
-     * the replay.  In case of doubt, FIXME.)
-     */
-
-    if ((old_fp = fopen(config_user(filename), FMODE_RB)))
-    {
-        if ((new_fp = tmpfile()))
-        {
-            if (demo_header_read(old_fp, &d))
-            {
-                FILE *save_fp;
-
-                /* Modify and write the header. */
-
-                strncpy(d.player, player, sizeof (d.player));
-
-                demo_header_write(new_fp, &d);
-
-                /*
-                 * Restore the last three fields not written by the above call.
-                 */
-
-                /* Hack, hack, hack. */
-
-                save_fp = demo_fp;
-                demo_fp = new_fp;
-
-                demo_play_stat(d.status, d.coins, d.timer);
-
-                demo_fp = save_fp;
-
-                /* Copy the remaining data. */
-
-                file_copy(old_fp, new_fp);
-
-                /* Then copy everything back. */
-
-                if (freopen(config_user(filename), FMODE_WB, old_fp))
-                {
-                    fseek(new_fp, 0L, SEEK_SET);
-                    file_copy(new_fp, old_fp);
-                }
-            }
-            fclose(new_fp);
-        }
-        fclose(old_fp);
-    }
-#endif
+    /* TODO */
+    return;
 }
 
 /*---------------------------------------------------------------------------*/