| @@ -197,7 +197,7 @@ selpasteb(Biobuf *b) · 196 unmodified lines |
| 197 | cols = MIN(n, field.width-sel.min.x); | 197 | cols = MIN(n, field.width-sel.min.x); |
| 198 | if (sel.min.y+rows < field.height) { | 198 | if (sel.min.y+rows < field.height) { |
| 199 | for (i = 0; i < n; i++) | 199 | for (i = 0; i < n; i++) |
| 200 | if (s[i] == ' ') | 200 | if (!orca_is_valid_glyph(s[i])) |
| 201 | s[i] = '.'; | 201 | s[i] = '.'; |
| 202 | memmove(&field.buffer[sel.min.x + field.width*(sel.min.y+rows)], s, MIN(n, field.width-sel.min.x)); | 202 | memmove(&field.buffer[sel.min.x + field.width*(sel.min.y+rows)], s, MIN(n, field.width-sel.min.x)); |
| 203 | rows++; | 203 | rows++; |
| @@ -234,7 +234,7 @@ shellpipe(char *s) · 30 unmodified lines |
| 234 | int x, y, p[4]; | 234 | int x, y, p[4]; |
| 235 | Glyph g; | 235 | Glyph g; |
| 236 | | 236 | |
| 237 | shellcmd = s; | 237 | shellcmd = s+1; |
| 238 | pipe(p); | 238 | pipe(p); |
| 239 | pipe(p+2); | 239 | pipe(p+2); |
| 240 | procrfork(runshell, p, 4096, RFFDG); | 240 | procrfork(runshell, p, 4096, RFFDG); |
| @@ -242,7 +242,7 @@ shellpipe(char *s) · 1 unmodified line |
| 242 | close(p[3]); | 242 | close(p[3]); |
| 243 | out = Bfdopen(p[1], OWRITE); | 243 | out = Bfdopen(p[1], OWRITE); |
| 244 | in = Bfdopen(p[2], OREAD); | 244 | in = Bfdopen(p[2], OREAD); |
| 245 | for (y = sel.min.y; y <= sel.max.y; y++) { | 245 | for (y = sel.min.y; *s != '<' && y <= sel.max.y; y++) { |
| 246 | for (x = sel.min.x; x <= sel.max.x; x++) { | 246 | for (x = sel.min.x; x <= sel.max.x; x++) { |
| 247 | if ((g = fieldget(x, y)) == '.') | 247 | if ((g = fieldget(x, y)) == '.') |
| 248 | g = ' '; | 248 | g = ' '; |
| @@ -251,7 +251,8 @@ shellpipe(char *s) · 2 unmodified lines |
| 251 | Bputc(out, '\n'); | 251 | Bputc(out, '\n'); |
| 252 | } | 252 | } |
| 253 | Bterm(out); | 253 | Bterm(out); |
| 254 | selpasteb(in); | 254 | if (*s != '>') |
| | 255 | selpasteb(in); |
| 255 | Bterm(in); | 256 | Bterm(in); |
| 256 | } | 257 | } |
| 257 | | 258 | |
| @@ -267,8 +268,8 @@ command(char *s) · 9 unmodified lines |
| 267 | s++; | 268 | s++; |
| 268 | } | 269 | } |
| 269 | | 270 | |
| 270 | if (s[0] == '|') { | 271 | if (s[0] == '|' || s[0] == '>' || s[0] == '<') { |
| 271 | shellpipe(s+1); | 272 | shellpipe(s); |
| 272 | return; | 273 | return; |
| 273 | } | 274 | } |
| 274 | | 275 | |