X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.c;h=8b5ba644af423de6932eec728ccf475d63e3761d;hb=1c1621da699adae49a4344b145f856dacb57270c;hp=9f5793c5865056735821303634b4513c89fc48f2;hpb=7d32471efffa825f52d24930b5ee617105f9c83e;p=st.git diff --git a/st.c b/st.c index 9f5793c..8b5ba64 100644 --- a/st.c +++ b/st.c @@ -796,7 +796,7 @@ selcopy(void) { } /* \n at the end of every selected line except for the last one */ if(is_selected && y < sel.e.y) - *ptr++ = '\n'; + *ptr++ = '\r'; } *ptr = 0; } @@ -1295,7 +1295,6 @@ tnewline(int first_col) { void csiparse(void) { - /* int noarg = 1; */ char *p = csiescseq.buf, *np; long int v; @@ -1306,9 +1305,10 @@ csiparse(void) { } while(p < csiescseq.buf+csiescseq.len) { + np = NULL; v = strtol(p, &np, 10); if(np == p) - break; + v = 0; if(v == LONG_MAX || v == LONG_MIN) v = -1; csiescseq.arg[csiescseq.narg++] = v;