tExit without printing alarming error messages if we are asked to convert a high score file that is already OK; have the RPM automatically convert an old score file (if present) on install. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 92f4ddd56ec9e9acd92b81570bdd3f25a8325e85
(DIR) parent b3cff1ab4e0b62024e0408c2a47b9c762cdeaae9
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Mon, 7 Oct 2002 10:42:27 +0000
Exit without printing alarming error messages if we are asked to convert
a high score file that is already OK; have the RPM automatically convert
an old score file (if present) on install.
Diffstat:
M dopewars.spec | 3 +++
M src/serverside.c | 9 ++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/dopewars.spec b/dopewars.spec
t@@ -53,6 +53,9 @@ make install DESTDIR=${RPM_BUILD_ROOT}
%clean
test "$RPM_BUILD_ROOT" != "/" && rm -rf ${RPM_BUILD_ROOT}
+%post
+%{_bindir}/dopewars -C %{_datadir}/dopewars.sco
+
%files -f %{name}.lang
%defattr(-,root,root)
%doc ChangeLog LICENCE README doc/aiplayer.html doc/clientplay.html
(DIR) diff --git a/src/serverside.c b/src/serverside.c
t@@ -1922,9 +1922,7 @@ void ConvertHighScoreFile(const gchar *convertfile)
* header */
rewind(old);
if (HighScoreReadHeader(old, NULL)) {
- g_log(NULL, G_LOG_LEVEL_CRITICAL,
- _("The high score file %s\n"
- "is already in the new format! Aborting."), convertfile);
+ /* Do nothing, except close the open files */
fclose(old);
fclose(backup);
} else {
t@@ -1934,10 +1932,11 @@ void ConvertHighScoreFile(const gchar *convertfile)
rewind(old);
while (1) {
ch = fgetc(old);
- if (ch == EOF)
+ if (ch == EOF) {
break;
- else
+ } else {
fputc(ch, backup);
+ }
}
fclose(backup);