summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2008-01-24 05:50:26 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2008-01-24 05:50:26 +0000
commitc1e06cf9767967b93fac4f1375cbe46e3143bebc (patch)
tree6bc0824ad8255ba7cbe4442b4e6c946a8c2439c2 /games-mud/kmuddy
parentStable for HPPA (bug #207154). (diff)
downloadgentoo-2-c1e06cf9767967b93fac4f1375cbe46e3143bebc.tar.gz
gentoo-2-c1e06cf9767967b93fac4f1375cbe46e3143bebc.tar.bz2
gentoo-2-c1e06cf9767967b93fac4f1375cbe46e3143bebc.zip
add patch from Tanktalus@gmail.com to avoid crash on extreme idle time (bug #206357)
(Portage version: 2.1.3.19)
Diffstat (limited to 'games-mud/kmuddy')
-rw-r--r--games-mud/kmuddy/ChangeLog9
-rw-r--r--games-mud/kmuddy/files/kmuddy-0.8-idle-crash.patch110
-rw-r--r--games-mud/kmuddy/kmuddy-0.8.ebuild8
3 files changed, 122 insertions, 5 deletions
diff --git a/games-mud/kmuddy/ChangeLog b/games-mud/kmuddy/ChangeLog
index 0433f97caef4..b4d08952db05 100644
--- a/games-mud/kmuddy/ChangeLog
+++ b/games-mud/kmuddy/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for games-mud/kmuddy
-# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-mud/kmuddy/ChangeLog,v 1.17 2007/10/14 22:07:04 mr_bones_ Exp $
+# Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-mud/kmuddy/ChangeLog,v 1.18 2008/01/24 05:50:25 mr_bones_ Exp $
+
+ 24 Jan 2008; Michael Sterrett <mr_bones_@gentoo.org>
+ +files/kmuddy-0.8-idle-crash.patch, kmuddy-0.8.ebuild:
+ add patch from Tanktalus@gmail.com to avoid crash on extreme idle time
+ (bug #206357)
14 Oct 2007; Michael Sterrett <mr_bones_@gentoo.org>
+files/kmuddy-0.8-nocrash.patch, kmuddy-0.8.ebuild:
diff --git a/games-mud/kmuddy/files/kmuddy-0.8-idle-crash.patch b/games-mud/kmuddy/files/kmuddy-0.8-idle-crash.patch
new file mode 100644
index 000000000000..948676b253c0
--- /dev/null
+++ b/games-mud/kmuddy/files/kmuddy-0.8-idle-crash.patch
@@ -0,0 +1,110 @@
+diff -ru kmuddy-0.8/lib/cstatus.cpp kmuddy-0.8.patch/lib/cstatus.cpp
+--- kmuddy-0.8/lib/cstatus.cpp 2005-10-19 02:01:52.000000000 -0600
++++ kmuddy-0.8.patch/lib/cstatus.cpp 2008-01-16 20:06:09.000000000 -0700
+@@ -16,6 +16,9 @@
+ * *
+ ***************************************************************************/
+
++//Sets the size of the status buffer which controls time displayer
++#define status_size 30
++
+ #include "cstatus.h"
+
+ #include <qdatetime.h>
+@@ -37,8 +40,8 @@
+
+ sb->insertItem (" " + i18n ("Off-line") + " ", ID_CONNECTED, 0, true);
+ sb->insertItem (" ??x?? ", ID_DIMENSION, 0, true);
+- sb->insertItem (" 0:00:00 ", ID_TIMER, 0, true);
+- sb->insertItem (" " + i18n ("idle") + " 0:00 ", ID_IDLE, 0, true);
++ sb->insertItem (" 00D:00H:00M:00S ", ID_TIMER, 0, true);
++ sb->insertItem (" " + i18n ("idle") + " 00D:00H:00M:00S ", ID_IDLE, 0, true);
+ sb->insertItem ("", ID_VARIABLES);
+ sb->insertItem ("", ID_PARTIAL);
+ timerShown = true;
+@@ -116,7 +119,7 @@
+ if (!timerShown)
+ {
+ timerReset ();
+- sb->changeItem (" 0:00:00 ", ID_TIMER);
++ sb->changeItem (" 00D:00H:00M:00S ", ID_TIMER);
+ }
+ timerShown = true;
+ }
+@@ -138,7 +141,7 @@
+
+ void cStatus::dimensionsChanged (int x, int y)
+ {
+- char s1[10];
++ char s1[status_size];
+ QString s2;
+ sprintf (s1, " %dx%d ", x, y);
+ s2 = s1;
+@@ -166,8 +169,8 @@
+ conntime = 0;
+ idletime1 = 0;
+ if (timerShown)
+- sb->changeItem (" 0:00:00 ", ID_TIMER);
+- sb->changeItem (" " + i18n ("idle") + " 0:00", ID_IDLE);
++ sb->changeItem (" 00D:00H:00M:00S ", ID_TIMER);
++ sb->changeItem (" " + i18n ("idle") + " 00D:00H:00M:00S", ID_IDLE);
+ timer1->start (1000);
+ }
+
+@@ -175,7 +178,7 @@
+ {
+ sb->changeItem (" " + i18n ("Connected") + " ", ID_CONNECTED);
+ sb->changeItem ("", ID_PARTIAL);
+- sb->changeItem (" " + i18n ("idle") + " 0:00 ", ID_IDLE);
++ sb->changeItem (" " + i18n ("idle") + " 00D:00H:00M:00S ", ID_IDLE);
+ showMessage (i18n ("Connected."));
+ }
+
+@@ -209,18 +212,19 @@
+ idletime1 = 0;
+ timer1->stop ();
+ timer1->start (1000);
+- sb->changeItem (" " + i18n ("idle") + " 0:00 ", ID_IDLE);
++ sb->changeItem (" " + i18n ("idle") + " 00D:00H:00M:00S ", ID_IDLE);
+ }
+ }
+
+ const QString cStatus::connTimeString ()
+ {
+- char s1[10];
+- int h = conntime / 3600;
++ char s1[status_size];
++ int d = conntime / (3600*24);
++ int h = (conntime / 3600) % 24;
+ int s = conntime % 3600;
+ int m = s / 60;
+ s = s % 60;
+- sprintf (s1, " %d:%02d:%02d ", h, m, s);
++ sprintf (s1, " %02dD:%02dH:%02dM:%02dS ", d, h, m, s);
+ QString s2 = s1;
+ return s2;
+ }
+@@ -246,16 +250,14 @@
+ {
+ ++idletime1;
+
+- int h, m, s;
++ int d, h, m, s;
+ s = idletime1 % 60;
+ m = ((idletime1 - s) / 60) % 60;
+- h = (idletime1 - s) / 3600;
++ h = (idletime1 - s) / 3600 % 24;
++ d = (idletime1 - s) / (3600 * 24);
+
+- char ss[15];
+- if (h > 0)
+- sprintf (ss, " %d:%02d:%02d ", h, m, s);
+- else
+- sprintf (ss, " %d:%02d ", m, s);
++ char ss[status_size];
++ sprintf (ss, " %02dD:%02dH:%02dM:%02dS ", d, h, m, s);
+
+ sb->changeItem (" " + i18n ("idle") + ss, ID_IDLE);
+ }
+Only in kmuddy-0.8.patch/lib: cstatus.cpp.orig
+Only in kmuddy-0.8.patch/lib: cstatus.cpp.rej
diff --git a/games-mud/kmuddy/kmuddy-0.8.ebuild b/games-mud/kmuddy/kmuddy-0.8.ebuild
index c97a33061104..502684a17268 100644
--- a/games-mud/kmuddy/kmuddy-0.8.ebuild
+++ b/games-mud/kmuddy/kmuddy-0.8.ebuild
@@ -1,6 +1,6 @@
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-mud/kmuddy/kmuddy-0.8.ebuild,v 1.4 2007/10/14 22:07:04 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-mud/kmuddy/kmuddy-0.8.ebuild,v 1.5 2008/01/24 05:50:25 mr_bones_ Exp $
inherit eutils kde-functions
@@ -21,7 +21,9 @@ need-kde 3
src_unpack() {
unpack ${A}
cd "${S}"
- epatch "${FILESDIR}/${P}-nocrash.patch"
+ epatch \
+ "${FILESDIR}/${P}-nocrash.patch" \
+ "${FILESDIR}/${P}-idle-crash.patch"
}
src_compile() {