8 Commits
0.8 ... 0.8.1

Author SHA1 Message Date
6f0f2b7ec3 bump version to 0.8.1 2018-03-20 21:29:10 +01:00
f4020b2cc4 fix regression by selecting clipboard text
"restore the old behaviour that the primary doesn't get deleted by a simple
left click"

Patch by Daniel Tameling <tamelingdaniel@gmail.com>, thanks!
2018-03-20 21:25:30 +01:00
a5a928bfc1 don't modify argv, use a counter
on some platforms (OpenBSD) this changes the exposed argv in tools using
the kvm_* interface, such as ps and pgrep.
2018-03-20 21:22:27 +01:00
6ac8c8aa50 selextend: clarify: !sel.mode == SEL_IDLE 2018-03-17 13:48:29 +01:00
5345db3c9b clipcopy: no need to check for free(NULL), set to NULL after free 2018-03-17 13:48:10 +01:00
7648697f71 minor code-style: whitespace fixes 2018-03-16 16:45:58 +01:00
0b507bb731 Fix title initialization 2018-03-16 16:44:30 +01:00
e7ef3c4ce9 Fix regression from 69e32a6 when setting title. 2018-03-16 16:44:30 +01:00
4 changed files with 26 additions and 22 deletions

22
arg.h
View File

@ -21,28 +21,30 @@ extern char *argv0;
argc--;\ argc--;\
break;\ break;\
}\ }\
for (brk_ = 0, argv[0]++, argv_ = argv;\ int i_;\
argv[0][0] && !brk_;\ for (i_ = 1, brk_ = 0, argv_ = argv;\
argv[0]++) {\ argv[0][i_] && !brk_;\
i_++) {\
if (argv_ != argv)\ if (argv_ != argv)\
break;\ break;\
argc_ = argv[0][0];\ argc_ = argv[0][i_];\
switch (argc_) switch (argc_)
#define ARGEND }\ #define ARGEND }\
} }
#define ARGC() argc_ #define ARGC() argc_
#define EARGF(x) ((argv[0][1] == '\0' && argv[1] == NULL)?\ #define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
((x), abort(), (char *)0) :\ ((x), abort(), (char *)0) :\
(brk_ = 1, (argv[0][1] != '\0')?\ (brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][1]) :\ (&argv[0][i_+1]) :\
(argc--, argv++, argv[0]))) (argc--, argv++, argv[0])))
#define ARGF() ((argv[0][1] == '\0' && argv[1] == NULL)?\ #define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
(char *)0 :\ (char *)0 :\
(brk_ = 1, (argv[0][1] != '\0')?\ (brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][1]) :\ (&argv[0][i_+1]) :\
(argc--, argv++, argv[0]))) (argc--, argv++, argv[0])))
#endif #endif

View File

@ -1,5 +1,5 @@
# st version # st version
VERSION = 0.8 VERSION = 0.8.1
# Customize below to fit your system # Customize below to fit your system

5
st.c
View File

@ -461,7 +461,7 @@ selextend(int col, int row, int type, int done)
{ {
int oldey, oldex, oldsby, oldsey, oldtype; int oldey, oldex, oldsby, oldsey, oldtype;
if (!sel.mode) if (sel.mode == SEL_IDLE)
return; return;
if (done && sel.mode == SEL_EMPTY) { if (done && sel.mode == SEL_EMPTY) {
selclear(); selclear();
@ -740,7 +740,6 @@ sigchld(int a)
exit(0); exit(0);
} }
void void
stty(char **args) stty(char **args)
{ {
@ -762,7 +761,7 @@ stty(char **args)
} }
*q = '\0'; *q = '\0';
if (system(cmd) != 0) if (system(cmd) != 0)
perror("Couldn't call stty"); perror("Couldn't call stty");
} }
int int

19
x.c
View File

@ -245,8 +245,8 @@ clipcopy(const Arg *dummy)
{ {
Atom clipboard; Atom clipboard;
if (xsel.clipboard != NULL) free(xsel.clipboard);
free(xsel.clipboard); xsel.clipboard = NULL;
if (xsel.primary != NULL) { if (xsel.primary != NULL) {
xsel.clipboard = xstrdup(xsel.primary); xsel.clipboard = xstrdup(xsel.primary);
@ -618,6 +618,9 @@ selrequest(XEvent *e)
void void
setsel(char *str, Time t) setsel(char *str, Time t)
{ {
if (!str)
return;
free(xsel.primary); free(xsel.primary);
xsel.primary = str; xsel.primary = str;
@ -1492,7 +1495,7 @@ void
xsettitle(char *p) xsettitle(char *p)
{ {
XTextProperty prop; XTextProperty prop;
DEFAULT(p, "st"); DEFAULT(p, opt_title);
Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle, Xutf8TextListToTextProperty(xw.dpy, &p, 1, XUTF8StringStyle,
&prop); &prop);
@ -1929,12 +1932,12 @@ main(int argc, char *argv[])
} ARGEND; } ARGEND;
run: run:
if (argc > 0) { if (argc > 0) /* eat all remaining arguments */
/* eat all remaining arguments */
opt_cmd = argv; opt_cmd = argv;
if (!opt_title && !opt_line)
opt_title = basename(xstrdup(argv[0])); if (!opt_title)
} opt_title = (opt_line || !opt_cmd) ? "st" : opt_cmd[0];
setlocale(LC_CTYPE, ""); setlocale(LC_CTYPE, "");
XSetLocaleModifiers(""); XSetLocaleModifiers("");
cols = MAX(cols, 1); cols = MAX(cols, 1);