Ports/SDLPoP: Remove an unnecessary patch

This patch removed some previously unsupported scanf format specifiers.

We still don't support these properly, but we can parse and ignore
them, which is equivalent to what this patch was doing.
This commit is contained in:
Tim Ledbetter 2023-08-13 12:38:28 +01:00 committed by Tim Schumacher
parent 43b4e84d9c
commit 5a04781224
5 changed files with 4 additions and 60 deletions

View file

@ -9,7 +9,7 @@ This just disables some extra features the game has such as screenshots, hardwar
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/config.h b/src/config.h
index 698e7ed..0a935ee 100644
index 698e7edf436461c475cbe4531ef8bf8d10456cd5..0a935eeb353141fcf4db3b4bcfb6925a6679df98 100644
--- a/src/config.h
+++ b/src/config.h
@@ -35,7 +35,7 @@ The authors of this program may be contacted at https://forum.princed.org

View file

@ -10,7 +10,7 @@ accessible as <SDL2/...>.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/types.h b/src/types.h
index 1f696d1..b5ede07 100644
index 1f696d17ee20a1623fbd4501f0d9afb9aec99f93..b5ede077a4686911912463310b425fe431bd0138 100644
--- a/src/types.h
+++ b/src/types.h
@@ -31,8 +31,8 @@ The authors of this program may be contacted at https://forum.princed.org

View file

@ -10,7 +10,7 @@ they're found.
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3558a6c..d074e48 100644
index 3558a6c78bda56023dc23b271d01a9026a7aed5b..d074e488bf2b493a553e1920fd8fafdb8b1965ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,10 +14,10 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${SDLPoP_SOURCE_DIR}/..")

View file

@ -1,49 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Manuel Palenzuela <manuelpalenzuelamerino@gmail.com>
Date: Sat, 3 Apr 2021 17:53:44 +0200
Subject: [PATCH] Remove some unsupported scanf format specifiers
(Note that scanf has been rewritten since and probably supports these
modifiers now, so this patch might not be necessary)
---
src/options.c | 6 +++---
src/seg009.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/options.c b/src/options.c
index 1bfe473..2bf173e 100644
--- a/src/options.c
+++ b/src/options.c
@@ -56,8 +56,8 @@ int ini_load(const char *filename,
}
while (!feof(f)) {
- if (fscanf(f, "[%127[^];\n]]\n", section) == 1) {
- } else if ((cnt = fscanf(f, " %63[^=;\n] = %255[^;\n]", name, value))) {
+ if (fscanf(f, "[%[^];\n]]\n", section) == 1) {
+ } else if ((cnt = fscanf(f, " %[^=;\n] = %[^;\n]", name, value))) {
if (cnt == 1)
*value = 0;
for (s = name + strlen(name) - 1; s > name && isspace(*s); s--)
@@ -66,7 +66,7 @@ int ini_load(const char *filename,
*s = 0;
report(section, name, value);
}
- if (fscanf(f, " ;%*[^\n]") != 0 ||
+ if (fscanf(f, " ;%[^\n]") != 0 ||
fscanf(f, " \n") != 0) {
fprintf(stderr, "short read from %s!?\n", filename);
fclose(f);
diff --git a/src/seg009.c b/src/seg009.c
index 139c2d8..e2047fb 100644
--- a/src/seg009.c
+++ b/src/seg009.c
@@ -2077,7 +2077,7 @@ void load_sound_names() {
while (!feof(fp)) {
int index;
char name[POP_MAX_PATH];
- if (fscanf(fp, "%d=%255s\n", &index, /*sizeof(name)-1,*/ name) != 2) {
+ if (fscanf(fp, "%d=%s\n", &index, /*sizeof(name)-1,*/ name) != 2) {
perror(names_path);
continue;
}

View file

@ -13,14 +13,7 @@ Use the correct include paths for SDL
The SDL port is installed into /usr/local, and its headers are
accessible as <SDL2/...>.
## `0003-Remove-some-unsupported-scanf-format-specifiers.patch`
Remove some unsupported scanf format specifiers
(Note that scanf has been rewritten since and probably supports these
modifiers now, so this patch might not be necessary)
## `0004-Fix-SDL2-include-path.patch`
## `0003-Fix-SDL2-include-path.patch`
Fix SDL2 include path