… | |
… | |
871 | char buf[1024]; /* HACK */ |
871 | char buf[1024]; /* HACK */ |
872 | snprintf (buf, sizeof (buf), "[%s]", current->desc); |
872 | snprintf (buf, sizeof (buf), "[%s]", current->desc); |
873 | split_line (listlen - 1, buf, current->color); |
873 | split_line (listlen - 1, buf, current->color); |
874 | } |
874 | } |
875 | |
875 | |
876 | /* if this is the same file we showed last, and the |
876 | /* if we're dealing with partial lines, and the last |
877 | * last time we showed it, it wasn't finished, then |
877 | * time we showed the line it wasn't finished ... */ |
878 | * append to the last line shown */ |
|
|
879 | if (lastprinted == current && current->lastpartial) |
|
|
880 | append_line (listlen - 1, current->buf); |
|
|
881 | else if (current->lastpartial) |
878 | if (!opt_whole && current->lastpartial) |
882 | { |
879 | { |
|
|
880 | /* if this is the same file we showed last then |
|
|
881 | append to the last line shown */ |
|
|
882 | if (lastprinted == current) |
|
|
883 | append_line (listlen - 1, current->buf); |
|
|
884 | else |
|
|
885 | { |
|
|
886 | /* but if a different file has been shown in the |
|
|
887 | * mean time, make a new line, starting with the |
|
|
888 | * continuation string */ |
883 | split_line (listlen - 1, continuation, current->color); |
889 | split_line (listlen - 1, continuation, current->color); |
884 | append_line (listlen - 1, current->buf); |
890 | append_line (listlen - 1, current->buf); |
|
|
891 | } |
885 | } |
892 | } |
886 | else |
893 | else |
|
|
894 | /* otherwise just make a plain and simple new line */ |
887 | split_line (listlen - 1, current->buf, current->color); |
895 | split_line (listlen - 1, current->buf, current->color); |
888 | |
896 | |
889 | free (current->buf), current->buf = 0; |
897 | free (current->buf), current->buf = 0; |
890 | current->index = listlen - 1; |
898 | current->index = listlen - 1; |
891 | lastprinted = current; |
899 | lastprinted = current; |
… | |
… | |
1153 | |
1161 | |
1154 | if (opt_partial) |
1162 | if (opt_partial) |
1155 | /* if we specifically requested to see partial lines then don't insist on whole lines */ |
1163 | /* if we specifically requested to see partial lines then don't insist on whole lines */ |
1156 | opt_whole = 0; |
1164 | opt_whole = 0; |
1157 | else if (file_count > 1) |
1165 | else if (file_count > 1) |
1158 | /* otherwise, if we've viewing multiple files, default to showing whole lines */ |
1166 | /* otherwise, if we're viewing multiple files, default to showing whole lines */ |
1159 | opt_whole = 1; |
1167 | opt_whole = 1; |
1160 | |
1168 | |
1161 | #if HAS_REGEX |
1169 | #if HAS_REGEX |
1162 | if (transform) |
1170 | if (transform) |
1163 | { |
1171 | { |