File: unix2dos.c

package info (click to toggle)
primrose 6%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,296 kB
  • sloc: cpp: 27,318; php: 765; ansic: 636; objc: 272; sh: 136; makefile: 95; perl: 67
file content (22 lines) | stat: -rw-r--r-- 235 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <stdlib.h>

int
main(void)
{
	while(1) {
		int c = getchar();

		if(c == EOF)
			exit(0);

		if(c == '\n') {
			putchar(015);	/* ^M */
			putchar(012);	/* ^J */
		} else {
			putchar(c);
		}
	}

	exit(0);
}