]> skyeroc.xyz Git - dgamelaunch/commitdiff
If we can't read from the canned rc file, don't create empty default one.
authorPasi Kallinen <paxed@alt.org>
Thu, 20 Mar 2008 17:03:17 +0000 (17:03 +0000)
committerPasi Kallinen <paxed@alt.org>
Thu, 20 Mar 2008 17:03:17 +0000 (17:03 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@425 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

dgl-common.c

index 0e95e6439cd689f5f2505ebba9d22362606ce284..924408fc8571e8cec54500d6fa1e5eeec59b5f3a 100644 (file)
@@ -157,8 +157,8 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
                char buf[1024];
                size_t bytes;
                /* FIXME: use nethack-themed error messages here, as per write_canned_rcfile() */
-               if (!(newfile = fopen (p2, "w"))) break;
                if (!(cannedf = fopen (p1, "r"))) break;
+               if (!(newfile = fopen (p2, "w"))) break;
                while ((bytes = fread (buf, 1, 1024, cannedf)) > 0) {
                    if (fwrite (buf, 1, bytes, newfile) != bytes) {
                        if (ferror (newfile)) {