I recently updated an older program of mine to create a linux shell file as well as a dos bat file.
I deal with both linux and windows systems using a common program between the two platforms. The program is called via a batch file or shell script, and to keep life simple I wrote a program in C to generate the equivalent script for each platform.
In the end to get things to work on the linux side of the house I need run dos2unix on the resulting file to convert the cr\lf to just cr.
What Im trying to do is find a way to force Pelles C to just generate the cr ...
Originally I had
if ((shtarget = fopen(cScriptType, "w")) == NULL)
and
fprintf(shtarget, "#####\n", NULL);
I changed that to
if ((shtarget = fopen(cScriptType, "wb")) == NULL)
and
fprintf(shtarget, "#####\xD", NULL);
The end result looks promising, ie notepad is a mess but it looks right in wordpad, but linux is still thinking its a cr / lf file.
Im still using 4.5x, I hate upgrading things that still work but I can and will upgrade if needed.
RSRC0009.DLL: Version 4.50.1
SUPPORT.DLL: Version 4.50.4
POCFMT.DLL: Version 4.50.3
PORC.DLL: Version 4.50.1
POBR.DLL: Version 4.50.2
POBR.EXE: Version 4.50.2
IDESPAWN.EXE: Version 4.50.1
POCC.EXE: Version 4.50.15
POLINK.EXE: Version 4.50.2
Thanks