(CC'ing two people that expressed interest in a previous thread, I hope that's alright)
``` $ cat /usr/ports/mystuff/x11/xst/pkg/DESCR xst is a fork of st, which is a simple virtual terminal emulator for X that sucks less. Some things specific to xst include: - Loads settings from Xresources. - Live-reloads settings from xrdb on USR1 signal (like termite). - Has cursor blinking options (and can persistently blink while typing). - A keybind alt+u for launching urls with dmenu + xurls. ``` Homepage: https://github.com/gnotclub/xst Porting notes: -------------- I noticed some warnings in the build that don't exist in x11/st, both related to `${WRKSRC}/xst.c`. The sprintf warning seemed easy enough to fix, but please double check that patch because C isn't a language I write anything in right now. Anyway, there's a different build warning I don't know how to fix, but still see as a potential issue because I can trigger a SIGSEGV with it: ``` In file included from x.c:243: ./xst.c:76:34: warning: expression which evaluates to zero treated as a null pointer constant of type 'char *' [-Wnon-literal-null-conversion] font2[endchar + count + 1] = '\0'; ``` One way to trigger the SIGSEGV is by setting `st.font_fallback` in .Xresources to a single comma because of the way the relevant code is structured: config.def.h line 9: ``` static char *font2[] = { /* "Inconsolata for Powerline:pixelsize=12:antialias=true:autohint=true", */ /* "Hack Nerd Font Mono:pixelsize=11:antialias=true:autohint=true", */ }; ``` xst.c line 65: ``` XRESOURCE_LOAD_META("font_fallback") { int count = 0, endchar = fonts_count = sizeof(font2) / sizeof(*font2); for (int i = 0; ret.addr[i]; i++) if (ret.addr[i] == ',') count++; if (count > 0) { for (int i = 0; i <= count; i++) { if (i == 0) font2[endchar + i] = strtok(ret.addr, ","); else font2[endchar + i] = strtok(NULL, ","); fonts_count++; } font2[endchar + count + 1] = '\0'; } else if (ret.addr) { font2[endchar] = ret.addr; fonts_count++; } } ``` Triggering the segmentation fault: ``` $ grep st.font_fallback ~/.Xresources st.font_fallback: , $ xst Segmentation fault (core dumped) $ egdb xst xst.core Reading symbols from xst... [New process 195719] Core was generated by `xst'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00000ec5e2d55653 in xloadsparefonts () at x.c:1173 1173 if (**fp == '-') (gdb) bt #0 0x00000ec5e2d55653 in xloadsparefonts () at x.c:1173 #1 0x00000ec5e2d5480d in xinit (cols=80, rows=24) at x.c:1333 #2 0x00000ec5e2d542d4 in main (argc=<optimized out>, argv=<optimized out>) at x.c:2759 (gdb) quit ``` As I said, I'm not sure how to fix that problem, but the way it creates undefined behavior like that seems bad. If anyone has any advice, I'd really appreciate it. Also, xst seems to use xurls, which isn't in the ports tree yet. I'm thinking xurls would need to get ported and then the Makefile of x11/xst would need to be revised to include xurls + x11/dmenu as RUN_DEPENDS? Here's a link to xurls: https://github.com/mvdan/xurls Any and all feedback and suggestions are welcome. I view this as needing more testing, and if there's a way to upstream a fix or two, I see that as a positive thing. I'm not in contact with upstream yet because I wanted to see what you all thought first. Thanks.
xst-0.9.0.tgz
Description: application/tar-gz