Introduction
Introduction Statistics Contact Development Disclaimer Help
tRemove non defined behaviour in selcopy - st - [fork] customized build of st, …
git clone git://src.adamsgaard.dk/st
Log
Files
Refs
README
LICENSE
---
commit 6521b5dc32d9bdc4d8826324cb7b2877910cc633
parent a8d5870073af14aa08032ab8520c5fe17bb8a1e8
Author: Roberto E. Vargas Caballero <[email protected]>
Date: Fri, 31 Jan 2014 17:30:00 +0100
Remove non defined behaviour in selcopy
It is not defined when lateral effects of expressions are
calculated, so an expression as:
--last >= gp && !(selected(last - gp, y)
is non portable.
Diffstat:
M st.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/st.c b/st.c
t@@ -953,11 +953,12 @@ selcopy(void) {
/* append every set & selected glyph to the selection */
for(y = sel.nb.y; y < sel.ne.y + 1; y++) {
gp = &term.line[y][0];
- last = gp + term.col;
+ last = &gp[term.col-1];
- while(--last >= gp && !(selected(last - gp, y) && \
- strcmp(last->c, " ") != 0))
- /* nothing */;
+ while(last >= gp && !(selected(last - gp, y) &&
+ strcmp(last->c, " ") != 0)) {
+ --last;
+ }
for(x = 0; gp <= last; x++, ++gp) {
if(!selected(x, y) || (gp->mode & ATTR_WDUMMY))
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.