Changeset e435537 in mainline for uspace/app/bdsh/cmds/modules/cat/cat.c
- Timestamp:
- 2012-07-17T15:14:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a00d555
- Parents:
- 9904eb90 (diff), dfc07c1 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
r9904eb90 re435537 176 176 177 177 bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0); 178 178 179 179 if (reading_stdin) { 180 180 fd = fileno(stdin); 181 181 /* Allow storing the whole UTF-8 character. */ 182 182 blen = STR_BOUNDS(1); 183 } else {183 } else 184 184 fd = open(fname, O_RDONLY); 185 }185 186 186 if (fd < 0) { 187 187 printf("Unable to open %s\n", fname); … … 222 222 bytes_to_read = 1; 223 223 } else { 224 if ((length != CAT_FULL_FILE) 225 &&(length - (off64_t)count <= (off64_t)(blen - copied_bytes))) {224 if ((length != CAT_FULL_FILE) && 225 (length - (off64_t)count <= (off64_t)(blen - copied_bytes))) { 226 226 bytes_to_read = (size_t) (length - count); 227 227 } else { … … 229 229 } 230 230 } 231 231 232 bytes = read(fd, buff + copied_bytes, bytes_to_read); 232 233 bytes += copied_bytes; … … 261 262 reads++; 262 263 } 263 264 if (reading_stdin) {264 265 if (reading_stdin) 265 266 fflush(stdout); 266 }267 267 } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE)); 268 268
Note:
See TracChangeset
for help on using the changeset viewer.