aports/community/jfsutils/gnu-basename.patch
Natanael Copa 20349c9320 community/jfsutils: fix use of basename
Also fix issue with not flushing stdout when prompting for user input
while at it. This was discovered while reproducing the issue.

fixes: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16284
ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/16106
2024-07-11 22:59:21 +02:00

27 lines
690 B
Diff

diff --git a/fsck/fsck_message.c b/fsck/fsck_message.c
index afbbf5a..da7db07 100644
--- a/fsck/fsck_message.c
+++ b/fsck/fsck_message.c
@@ -8,6 +8,8 @@
#include "jfs_endian.h"
#include "xfsckint.h"
+#define basename(name) (strrchr((name),'/') ? strrchr((name),'/')+1 : (name))
+
int msg_lvl = fsck_debug;
int dbg_output = 0;
diff --git a/fscklog/fscklog.c b/fscklog/fscklog.c
index 292adda..08aa385 100644
--- a/fscklog/fscklog.c
+++ b/fscklog/fscklog.c
@@ -76,6 +76,8 @@
#include "xfsck.h"
#include "fsck_message.h"
+#define basename(name) (strrchr((name),'/') ? strrchr((name),'/')+1 : (name))
+
struct fscklog_record fscklog_record;
struct fscklog_record *local_recptr;