Skip to content
  • rswindell's avatar
    Return to the sbbs v2 behavior of printfile() behavior (sort-of): When · b1ecd9b6
    rswindell authored
    P_OPENCLOSE mode flag is *not* specified, do not malloc()/read() the entire
    file and then display. Instead, print one line at a time (so long as that
    line is <= 1MB in length), calling putmsg() for each line.
    
    This should allow the viewing of massive text files in SBBS again without
    alloc/swap issues.
    
    I left the calls to utf8_normalize_str() in here, but I'm not so sure about
    them now. putmsg() will convert UTF-8 to CP437 through print_utf8_as_cp437(),
    and that only lacks a couple of conversions that utf8_normalize_str() does
    (e.g. ellipsis to "..."), so that might be a good candidate to remove in
    the future.
    b1ecd9b6