Xinqi Bao's Git
projects
/
st.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
Simplify loop condition.
[st.git]
/
st.c
diff --git
a/st.c
b/st.c
index
b2bcfe9
..
4ed8319
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-944,7
+944,7
@@
getsel(void) {
ptr = str = xmalloc(bufsize);
/* append every set & selected glyph to the selection */
ptr = str = xmalloc(bufsize);
/* append every set & selected glyph to the selection */
- for(y = sel.nb.y; y <
sel.ne.y + 1
; y++) {
+ for(y = sel.nb.y; y <
= sel.ne.y
; y++) {
linelen = tlinelen(y);
if(sel.type == SEL_RECTANGULAR) {
linelen = tlinelen(y);
if(sel.type == SEL_RECTANGULAR) {
@@
-3917,17
+3917,13
@@
run(void) {
long deltatime;
/* Waiting for window mapping */
long deltatime;
/* Waiting for window mapping */
-
while(1)
{
+
do
{
XNextEvent(xw.dpy, &ev);
XNextEvent(xw.dpy, &ev);
- if(XFilterEvent(&ev, None))
- continue;
if(ev.type == ConfigureNotify) {
w = ev.xconfigure.width;
h = ev.xconfigure.height;
if(ev.type == ConfigureNotify) {
w = ev.xconfigure.width;
h = ev.xconfigure.height;
- } else if(ev.type == MapNotify) {
- break;
}
}
- }
+ }
while(ev.type != MapNotify);
ttynew();
cresize(w, h);
ttynew();
cresize(w, h);