testing/wesnoth: fix segfault

This commit is contained in:
psykose 2022-04-09 12:47:51 +00:00 committed by alice
parent 65d71b1907
commit 047262d4e5
2 changed files with 15 additions and 1 deletions

View File

@ -24,7 +24,9 @@ makedepends="
sdl2_mixer-dev
"
subpackages="$pkgname-doc"
source="https://sourceforge.net/projects/wesnoth/files/wesnoth-$_major/wesnoth-$pkgver/wesnoth-$pkgver.tar.bz2"
source="https://sourceforge.net/projects/wesnoth/files/wesnoth-$_major/wesnoth-$pkgver/wesnoth-$pkgver.tar.bz2
fix-segfault.patch
"
options="!check" # No tests
build() {
@ -46,4 +48,5 @@ package() {
sha512sums="
bb1c307981de4990fc341310b358c5e1c54673d7434bc0a0fa0a7b5caf11e6db3255ad0eb57b6b188ff6ab8f287321fc8821813d0ef3661cfa637985070bb540 wesnoth-1.16.2.tar.bz2
8fc0f43719d0a5b7554a027f4367d5c7459549741b82c3c879385dd5c8e10e96a2064f329090ac2a0a5e853d5591a7ecd0ce650748f597cd81a90fb7d11581ae fix-segfault.patch
"

View File

@ -0,0 +1,11 @@
--- a/src/recall_list_manager.cpp
+++ b/src/recall_list_manager.cpp
@@ -57,7 +57,7 @@
void recall_list_manager::erase_if_matches_id(const std::string &unit_id)
{
recall_list_.erase(std::remove_if(recall_list_.begin(), recall_list_.end(),
- [&unit_id](const unit_ptr & ptr) { return ptr->id() == unit_id; }),
+ [unit_id](const unit_ptr & ptr) { return ptr->id() == unit_id; }),
recall_list_.end());
}