| 761 | \*-------------------------------------------------------------------------*/ |
| 762 | #define eolcandidate(c) (c == '\r' || c == '\n') |
| 763 | static int eolprocess(int c, int last, const char *marker, |
| 764 | luaL_Buffer *buffer) |
| 765 | { |
| 766 | if (eolcandidate(c)) { |
| 767 | if (eolcandidate(last)) { |
| 768 | if (c == last) luaL_addstring(buffer, marker); |
| 769 | return 0; |
| 770 | } else { |
| 771 | luaL_addstring(buffer, marker); |
| 772 | return c; |
| 773 | } |
| 774 | } else { |
| 775 | luaL_addchar(buffer, (char) c); |
| 776 | return 0; |
| 777 | } |
| 778 | } |
| 779 | |
| 780 | /*-------------------------------------------------------------------------*\ |
| 781 | * Converts a string to uniform EOL convention. |
no test coverage detected