diff -r a55a5664ceea st.c --- a/st.c Sun Oct 07 11:06:17 2012 +0200 +++ b/st.c Tue Oct 09 15:35:35 2012 +0200 @@ -662,7 +662,7 @@ void selcopy(void) { - char *str, *ptr, *p; + char *str, *ptr; int x, y, bufsize, is_selected = 0, size; Glyph *gp; @@ -677,11 +677,10 @@ for(x = 0; x < term.col; x++) { gp = &term.line[y][x]; - if(!(is_selected = selected(x, y))) + if(!(is_selected = selected(x, y)) || !(gp->state & GLYPH_SET)) continue; - p = (gp->state & GLYPH_SET) ? gp->c : " "; - size = utf8size(p); - memcpy(ptr, p, size); + size = utf8size(gp->c); + memcpy(ptr, gp->c, size); ptr += size; } /* \n at the end of every selected line except for the last one */