shithub: rgbds

Download patch

ref: 493b94919f06da05ce20b8ecae74e867a61f646e
parent: 71e22f3bfe52a4e33b6a77e860dd6f80f4bb7e53
author: ISSOtm <[email protected]>
date: Sat Mar 12 15:52:05 EST 2022

Fix -TAP being non-functional

--- a/src/gfx/main.cpp
+++ b/src/gfx/main.cpp
@@ -412,6 +412,7 @@
 #else
 			    "./"sv;
 #endif
+			size_t len = options.input.npos;
 			size_t i = options.input.find_last_of(chars);
 			if (i != options.input.npos && options.input[i] == '.') {
 				// We found the last dot, but check if it's part of a stem
@@ -418,10 +419,11 @@
 				// (There must be a non-path separator character before it)
 				if (i != 0 && chars.find(options.input[i - 1], 1) == chars.npos) {
 					// We can replace the extension
-					path.resize(i + 1); // Keep the dot, though
-					path.append(extension);
+					len = i;
 				}
 			}
+			path.assign(options.input, 0, len);
+			path.append(extension);
 		}
 	};
 	autoOutPath(autoAttrmap, options.attrmap, ".attrmap");