[Scummvm-git-logs] scummvm master -> 40787d48eed411db008b64ad9e8219749003f627

dreammaster paulfgilbert at gmail.com
Thu Mar 5 03:13:36 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
40787d48ee ULTIMA8: Avoid calling erase on empty string in credits


Commit: 40787d48eed411db008b64ad9e8219749003f627
    https://github.com/scummvm/scummvm/commit/40787d48eed411db008b64ad9e8219749003f627
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-03-04T19:13:32-08:00

Commit Message:
ULTIMA8: Avoid calling erase on empty string in credits

Changed paths:
    engines/ultima/ultima8/gumps/credits_gump.cpp


diff --git a/engines/ultima/ultima8/gumps/credits_gump.cpp b/engines/ultima/ultima8/gumps/credits_gump.cpp
index 9586a70713..aa03a653df 100644
--- a/engines/ultima/ultima8/gumps/credits_gump.cpp
+++ b/engines/ultima/ultima8/gumps/credits_gump.cpp
@@ -98,20 +98,19 @@ void CreditsGump::Close(bool no_del) {
 
 void CreditsGump::extractLine(Std::string &text_,
                               char &modifier, Std::string &line) {
-	if (text_.empty()) {
-		line = "";
-		modifier = 0;
-		return;
-	}
-
-	if (text_[0] == '+' || text_[0] == '&' || text_[0] == '}' || text_[0] == '~' ||
-	        text_[0] == '@') {
+	if (!text_.empty() and (text_[0] == '+' || text_[0] == '&' || text_[0] == '}' ||
+							text_[0] == '~' || text_[0] == '@')) {
 		modifier = text_[0];
 		text_.erase(0, 1);
 	} else {
 		modifier = 0;
 	}
 
+	if (text_.empty()) {
+		line = "";
+		return;
+	}
+
 	Std::string::size_type starpos = text_.find('*');
 
 	line = text_.substr(0, starpos);




More information about the Scummvm-git-logs mailing list