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