Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools/wintounix.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/wintounix.c')
-rw-r--r--tools/wintounix.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/wintounix.c b/tools/wintounix.c
new file mode 100644
index 0000000..8e6a3a0
--- /dev/null
+++ b/tools/wintounix.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+// This C code converts from Microsoft's #13#10 formatted files to UNIX.
+// See do-indent for details.
+main(int argc, char *argv[])
+{
+ FILE *f;
+ int c;
+ f = fopen(argv[1], "r");
+ while (!(feof(f))) {
+ c = fgetc(f);
+ if ((c != 0x0d) && (c != -1))
+ putchar(c);
+ }
+ fclose(f);
+}