rpms/wesnoth/devel wesnoth-1.0.2-help-speedup-199079.patch, NONE, 1.1 wesnoth.spec, 1.27, 1.28

Michael Schwendt (mschwendt) fedora-extras-commits at redhat.com
Tue Jul 18 14:21:24 UTC 2006


Author: mschwendt

Update of /cvs/extras/rpms/wesnoth/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27476

Modified Files:
	wesnoth.spec 
Added Files:
	wesnoth-1.0.2-help-speedup-199079.patch 
Log Message:
* Tue Jul 18 2006 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-3
- fix #199079, so loading some help pages like the "License" doesn't
  take ages
- remove BR SDL_ttf-devel, an included/patched copy is used since 0.8.7
- patch included SDL_ttf to build with freetype 2.x and not access
  an old freetype 1.x internal


wesnoth-1.0.2-help-speedup-199079.patch:

--- NEW FILE wesnoth-1.0.2-help-speedup-199079.patch ---
diff -Nur wesnoth-1.0.2-orig/src/help.cpp wesnoth-1.0.2/src/help.cpp
--- wesnoth-1.0.2-orig/src/help.cpp	2005-09-21 02:35:50.000000000 +0200
+++ wesnoth-1.0.2/src/help.cpp	2006-07-18 15:57:34.000000000 +0200
@@ -2581,20 +2581,23 @@
 
 std::string get_first_word(const std::string &s)
 {
-	if (s == "") {
+	if ( s.empty() ) {
 		return s;
 	}
 	size_t first_word_start = s.find_first_not_of(" ");
 	if (first_word_start == std::string::npos) {
-		first_word_start = 0;
+        return s;  // String consists of only spaces.
 	}
 	size_t first_word_end = s.find_first_of(" \n", first_word_start);
-	if (first_word_end == std::string::npos || first_word_end == first_word_start) {
-		// Either this word contains no spaces/newlines, or it consists
-		// of only spaces and newlines. In either case, use the whole
-		// chunk as a word.
+	if (first_word_end == std::string::npos) {
+		// This words ends with no spaces/newlines,
+        // Use the whole chunk as a word.
 		first_word_end = s.size();
 	}
+    else if ( first_word_end == first_word_start) {
+        // This word is '\n'.
+        first_word_end = first_word_start+1;
+    }
 	const std::string first_word = s.substr(0, first_word_end);
 	return first_word;
 }


Index: wesnoth.spec
===================================================================
RCS file: /cvs/extras/rpms/wesnoth/devel/wesnoth.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- wesnoth.spec	18 Jul 2006 09:36:36 -0000	1.27
+++ wesnoth.spec	18 Jul 2006 14:21:24 -0000	1.28
@@ -11,6 +11,7 @@
 Source2:        wesnoth.sysconfig
 #Source3:        README.fedora
 Patch0:         wesnoth-1.0.2-sdl_ttf.patch
+Patch1:         wesnoth-1.0.2-help-speedup-199079.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  SDL-devel, SDL_image-devel, SDL_mixer-devel
@@ -62,6 +63,7 @@
 %prep
 %setup -q
 %patch0 -p1 -b .sdl_ttf
+%patch1 -p1 -b .help-199079
 #cp %{SOURCE3} .
 chmod -x MANUAL*
 
@@ -161,6 +163,8 @@
 
 %changelog
 * Tue Jul 18 2006 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.0.2-3
+- fix #199079, so loading some help pages like the "License" doesn't
+  take ages
 - remove BR SDL_ttf-devel, an included/patched copy is used since 0.8.7
 - patch included SDL_ttf to build with freetype 2.x and not access
   an old freetype 1.x internal




More information about the fedora-extras-commits mailing list