From: Joshua Kwan Date: Tue, 17 Feb 2004 18:33:13 +0000 (+0000) Subject: don't always call write_canned_rcfile() X-Git-Tag: v1.6.1-roc-dev~455 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=8bfdcb26fe43b7e275a99ce1b31dc36860b92fce;p=dgamelaunch don't always call write_canned_rcfile() git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@245 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- diff --git a/Changelog b/Changelog index 7aca856..dabb323 100644 --- a/Changelog +++ b/Changelog @@ -4,6 +4,8 @@ if it is present, so beware. * Fixed some eerie race conditions that prevented writefile() from writing a full file all the time. (jilles) + * Don't write rcfiles if they already exist. (i.e., lost account + holders recreating their accounts. 1.4.1 (2004/02/13) * Don't explicitly unlock the lock file before fclosing it; diff --git a/dgamelaunch.c b/dgamelaunch.c index fe31b54..4074899 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -1052,7 +1052,9 @@ newuser () loggedin = 1; snprintf (rcfilename, 80, "%srcfiles/%s.nethackrc", myconfig->dglroot, me->username); - write_canned_rcfile (rcfilename); + + if (access (rcfilename, R_OK) == -1) + write_canned_rcfile (rcfilename); /* create their ttyrec dir */ snprintf (dirname, 100, "%sttyrec/%s", myconfig->dglroot, me->username);