Skip to content

Instantly share code, notes, and snippets.

@drj11
Created July 21, 2014 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drj11/ddf5a113a4d08f2c5677 to your computer and use it in GitHub Desktop.
Save drj11/ddf5a113a4d08f2c5677 to your computer and use it in GitHub Desktop.
toadcrlf - add CR before NL
#include <stdio.h>
int main(void)
{
int c;
while(1) {
c = getchar();
if(c == EOF) {
break;
}
if(c == '\n') {
putchar('\r');
}
putchar(c);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment