Commit 284e3d2
convert: track state in LF-to-CRLF filter
There may not be enough space to store CRLF in the output. If we don't
fill the buffer, then the filter will keep getting called with the same
short buffer and will loop forever.
Instead, always store the CR and record whether there's a missing LF
if so we store it in the output buffer the next time the function gets
called.
Reported-by: Henrik Grubbström <[email protected]>
Signed-off-by: Carlos Martín Nieto <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 703f05a commit 284e3d2
1 file changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
879 | 885 | | |
880 | 886 | | |
881 | 887 | | |
882 | 888 | | |
883 | | - | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
884 | 897 | | |
885 | 898 | | |
886 | | - | |
| 899 | + | |
| 900 | + | |
887 | 901 | | |
888 | 902 | | |
889 | | - | |
890 | | - | |
| 903 | + | |
| 904 | + | |
891 | 905 | | |
892 | 906 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
897 | 912 | | |
898 | 913 | | |
899 | 914 | | |
| |||
904 | 919 | | |
905 | 920 | | |
906 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
907 | 927 | | |
908 | 928 | | |
909 | | - | |
| 929 | + | |
910 | 930 | | |
911 | 931 | | |
912 | | - | |
913 | | - | |
914 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
915 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
916 | 940 | | |
917 | 941 | | |
918 | 942 | | |
| |||
1194 | 1218 | | |
1195 | 1219 | | |
1196 | 1220 | | |
1197 | | - | |
| 1221 | + | |
1198 | 1222 | | |
1199 | 1223 | | |
1200 | 1224 | | |
| |||
0 commit comments