diff --git a/wesnoth-1.0.2-help-speedup-199079.patch b/wesnoth-1.0.2-help-speedup-199079.patch new file mode 100644 index 0000000..497d494 --- /dev/null +++ b/wesnoth-1.0.2-help-speedup-199079.patch @@ -0,0 +1,33 @@ +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; + } diff --git a/wesnoth.spec b/wesnoth.spec index ea02b1a..dde9a0a 100644 --- a/wesnoth.spec +++ b/wesnoth.spec @@ -11,6 +11,7 @@ Source1: wesnothd.init 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 @@ This package contains the game editor and development tools. %prep %setup -q %patch0 -p1 -b .sdl_ttf +%patch1 -p1 -b .help-199079 #cp %{SOURCE3} . chmod -x MANUAL* @@ -161,6 +163,8 @@ fi %changelog * Tue Jul 18 2006 Michael Schwendt - 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