St 0.8.2 scrollback patch issue

#1

Hey there,
I am running into some issues trying to patch st with the scrollback patch.
Before, I patched st with the boxdraw patch and this worked perfectly.
Now when I run:

patch -Np1 -i st-scrollback-20190331-21367a0.diff

I get:

patching file config.def.h
Hunk #1 succeeded at 190 (offset 12 lines).
patching file st.c
Hunk #2 FAILED at 43.
Hunk #5 succeeded at 431 (offset 18 lines).
Hunk #6 succeeded at 543 (offset 18 lines).
Hunk #7 succeeded at 558 (offset 18 lines).
Hunk #8 succeeded at 586 (offset 18 lines).
Hunk #9 succeeded at 624 (offset 18 lines).
Hunk #10 succeeded at 853 (offset 18 lines).
Hunk #11 succeeded at 1067 (offset 18 lines).
Hunk #12 succeeded at 1127 (offset 18 lines).
Hunk #13 succeeded at 1192 (offset 18 lines).
Hunk #14 succeeded at 1360 (offset 21 lines).
Hunk #15 succeeded at 1797 (offset 20 lines).
Hunk #16 succeeded at 2303 (offset 19 lines).
Hunk #17 succeeded at 2316 (offset 19 lines).
Hunk #18 succeeded at 2535 (offset 20 lines).
Hunk #19 succeeded at 2572 (offset 20 lines).
Hunk #20 succeeded at 2637 (offset 20 lines).
Hunk #21 succeeded at 2658 with fuzz 1 (offset 20 lines).
1 out of 21 hunks FAILED -- saving rejects to file st.c.rej
patching file st.h
Hunk #1 succeeded at 81 (offset 1 line).

This is the content of st.c.rej:

--- st.c
+++ st.c
@@ -43,6 +44,9 @@
 #define ISCONTROLC1(c)		(BETWEEN(c, 0x80, 0x9f))
 #define ISCONTROL(c)		(ISCONTROLC0(c) || ISCONTROLC1(c))
 #define ISDELIM(u)		(u && wcschr(worddelimiters, u))
+#define TLINE(y)		((y) < term.scr ? term.hist[((y) + term.histi - \
+				term.scr + HISTSIZE + 1) % HISTSIZE] : \
+				term.line[(y) - term.scr])
 
 enum term_mode {
 	MODE_WRAP        = 1 << 0,

I have no idea what the issue may be and I couldn’t find anything about in online, either.

Any insights from anyone used to st/patching?
Thanks!

edit: sorry, forgot to mention: after manually adding the above lines to st.c make clean install works without an error. But I would still like to know what the issue might be for future reference.

0 Likes

#2

@xsme Hello. The most patches in dwm and st and other suckless stuff only works in vanilla builds.
If you have preconfigured suckless stuff you have to manually add the patches/lines. Exact what you have done with your st.

1 Like

#3

The suckless community is pretty adamant about the “no patch hand-holding” policy.

Because the project is always changing, unless you get the matching version for the patch it’s almost always gonna require manual intervention, I suggest manual patching (that’s how I do it anyhow)

The failure you’re getting is due to the addition of a new macro in that area ISCONTROLC0(c) which isn’t known to the patch so it bails out (far as I can tell anyhow).

If you just want an st build with scrollback and not much else I can link you my repo, on the other hand it’s quite fun/rewarding to figure it out.

3 Likes

#4

Awesome, thank you for your replies! I will keep your suggestions in mind and start patching manually instead of relying on *.diff files going forward.

Thanks a lot for the offer nate, I appreciate it! But you are right, I’d rather try and figure it out by myself and get back to you if I fail at some point if I may :slight_smile:

3 Likes