aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'st.c')
-rw-r--r--st.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/st.c b/st.c
index 4d543d1..37bec70 100644
--- a/st.c
+++ b/st.c
@@ -953,11 +953,12 @@ selcopy(void) {
953 /* append every set & selected glyph to the selection */ 953 /* append every set & selected glyph to the selection */
954 for(y = sel.nb.y; y < sel.ne.y + 1; y++) { 954 for(y = sel.nb.y; y < sel.ne.y + 1; y++) {
955 gp = &term.line[y][0]; 955 gp = &term.line[y][0];
956 last = gp + term.col; 956 last = &gp[term.col-1];
957 957
958 while(--last >= gp && !(selected(last - gp, y) && \ 958 while(last >= gp && !(selected(last - gp, y) &&
959 strcmp(last->c, " ") != 0)) 959 strcmp(last->c, " ") != 0)) {
960 /* nothing */; 960 --last;
961 }
961 962
962 for(x = 0; gp <= last; x++, ++gp) { 963 for(x = 0; gp <= last; x++, ++gp) {
963 if(!selected(x, y) || (gp->mode & ATTR_WDUMMY)) 964 if(!selected(x, y) || (gp->mode & ATTR_WDUMMY))
@@ -2152,20 +2153,21 @@ csireset(void) {
2152void 2153void
2153strhandle(void) { 2154strhandle(void) {
2154 char *p = NULL; 2155 char *p = NULL;
2155 int i, j, narg; 2156 int j, narg, par;
2156 2157
2157 strparse(); 2158 strparse();
2158 narg = strescseq.narg; 2159 narg = strescseq.narg;
2160 par = atoi(strescseq.args[0]);
2159 2161
2160 switch(strescseq.type) { 2162 switch(strescseq.type) {
2161 case ']': /* OSC -- Operating System Command */ 2163 case ']': /* OSC -- Operating System Command */
2162 switch(i = atoi(strescseq.args[0])) { 2164 switch(par) {
2163 case 0: 2165 case 0:
2164 case 1: 2166 case 1:
2165 case 2: 2167 case 2:
2166 if(narg > 1) 2168 if(narg > 1)
2167 xsettitle(strescseq.args[1]); 2169 xsettitle(strescseq.args[1]);
2168 break; 2170 return;
2169 case 4: /* color set */ 2171 case 4: /* color set */
2170 if(narg < 3) 2172 if(narg < 3)
2171 break; 2173 break;
@@ -2182,25 +2184,20 @@ strhandle(void) {
2182 */ 2184 */
2183 redraw(0); 2185 redraw(0);
2184 } 2186 }
2185 break; 2187 return;
2186 default:
2187 fprintf(stderr, "erresc: unknown str ");
2188 strdump();
2189 break;
2190 } 2188 }
2191 break; 2189 break;
2192 case 'k': /* old title set compatibility */ 2190 case 'k': /* old title set compatibility */
2193 xsettitle(strescseq.args[0]); 2191 xsettitle(strescseq.args[0]);
2194 break; 2192 return;
2195 case 'P': /* DSC -- Device Control String */ 2193 case 'P': /* DSC -- Device Control String */
2196 case '_': /* APC -- Application Program Command */ 2194 case '_': /* APC -- Application Program Command */
2197 case '^': /* PM -- Privacy Message */ 2195 case '^': /* PM -- Privacy Message */
2198 default: 2196 return;
2199 fprintf(stderr, "erresc: unknown str ");
2200 strdump();
2201 /* die(""); */
2202 break;
2203 } 2197 }
2198
2199 fprintf(stderr, "erresc: unknown str ");
2200 strdump();
2204} 2201}
2205 2202
2206void 2203void