Changeset a35b458 in mainline for uspace/app/bdsh/cmds/modules/cat
- Timestamp:
- 2018-03-02T20:10:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
-
uspace/app/bdsh/cmds/modules/cat/cat.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
r3061bc1 ra35b458 110 110 console_set_pos(console, 0, console_rows-1); 111 111 console_set_color(console, COLOR_WHITE, COLOR_BLUE, 0); 112 112 113 113 printf("ENTER/SPACE/PAGE DOWN - next page, " 114 114 "ESC/Q - quit, C - continue unpaged"); 115 115 fflush(stdout); 116 116 117 117 console_set_style(console, STYLE_NORMAL); 118 118 } … … 122 122 cons_event_t ev; 123 123 kbd_event_t *kev; 124 124 125 125 while (true) { 126 126 if (!console_get_event(console, &ev)) { … … 129 129 if (ev.type == CEV_KEY && ev.ev.key.type == KEY_PRESS) { 130 130 kev = &ev.ev.key; 131 131 132 132 if (kev->key == KC_ESCAPE || kev->key == KC_Q) { 133 133 should_quit = true; … … 190 190 191 191 bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0); 192 192 193 193 if (reading_stdin) { 194 194 fd = fileno(stdin); … … 201 201 } 202 202 } 203 203 204 204 if (fd < 0) { 205 205 printf("Unable to open %s\n", fname); … … 255 255 } 256 256 } 257 257 258 258 rc = vfs_read(fd, &pos, buff + copied_bytes, bytes_to_read, 259 259 &bytes); … … 283 283 paged_char(c); 284 284 } 285 285 286 286 } 287 287 count += bytes; 288 288 reads++; 289 289 } 290 290 291 291 if (reading_stdin) 292 292 fflush(stdout); … … 317 317 sysarg_t rows, cols; 318 318 errno_t rc; 319 319 320 320 /* 321 321 * reset global state … … 392 392 if (buffer < 4) 393 393 buffer = CAT_DEFAULT_BUFLEN; 394 394 395 395 if (more) { 396 396 rc = console_get_size(console, &cols, &rows);
Note:
See TracChangeset
for help on using the changeset viewer.
