Commit 3162a2ce authored by Brad King's avatar Brad King 💬
Browse files

BUG: Deal with windows newlines on binary cygwin mounts. This addresses bug#2191.

parent a9b4b3f0
...@@ -31,36 +31,23 @@ public: ...@@ -31,36 +31,23 @@ public:
<< "//" << endl << "//" << endl
<< "const char* " << title << " =" << "const char* " << title << " ="
<< endl << "\""; << endl << "\"";
int preproc = 0;
while ( ( ch = fgetc(fp) ) != EOF ) while ( ( ch = fgetc(fp) ) != EOF )
{ {
if ( preproc ) if ( ch == '\n' )
{ {
this->Stream << (unsigned char)ch; this->Stream << "\\n\"" << endl << "\"";
if ( ch == '\n' ) }
{ else if ( ch == '\\' )
preproc = 0; {
this->Stream << "\""; this->Stream << "\\\\";
}
} }
else else if ( ch == '\"' )
{ {
if ( ch == '\n' ) this->Stream << "\\\"";
{ }
this->Stream << "\\n\"" << endl << "\""; else if ( ch != '\r' )
} {
else if ( ch == '\\' ) this->Stream << (unsigned char)ch;
{
this->Stream << "\\\\";
}
else if ( ch == '\"' )
{
this->Stream << "\\\"";
}
else
{
this->Stream << (unsigned char)ch;
}
} }
} }
this->Stream << "\\n\";" << endl; this->Stream << "\\n\";" << endl;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment