Ignore:
Timestamp:
2012-07-20T20:29:54Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
34bc2fe
Parents:
4cdac68 (diff), 6de2d766 (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.
Message:

Merge with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r4cdac68 rb828907  
    176176
    177177        bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0);
    178 
     178       
    179179        if (reading_stdin) {
    180180                fd = fileno(stdin);
    181181                /* Allow storing the whole UTF-8 character. */
    182182                blen = STR_BOUNDS(1);
    183         } else {
     183        } else
    184184                fd = open(fname, O_RDONLY);
    185         }
     185       
    186186        if (fd < 0) {
    187187                printf("Unable to open %s\n", fname);
     
    222222                        bytes_to_read = 1;
    223223                } 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))) {
    226226                                bytes_to_read = (size_t) (length - count);
    227227                        } else {
     
    229229                        }
    230230                }
     231               
    231232                bytes = read(fd, buff + copied_bytes, bytes_to_read);
    232233                bytes += copied_bytes;
     
    261262                        reads++;
    262263                }
    263 
    264                 if (reading_stdin) {
     264               
     265                if (reading_stdin)
    265266                        fflush(stdout);
    266                 }
    267267        } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE));
    268268
Note: See TracChangeset for help on using the changeset viewer.