From 7609d19e3204390f5fb97f608e1c6f9132c40dee Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 8 Nov 2014 18:04:45 -0800 Subject: [PATCH] Fix bug where bad carriage returns mess up line endings. --- sourcepawn/compiler/libpawnc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sourcepawn/compiler/libpawnc.cpp b/sourcepawn/compiler/libpawnc.cpp index 8500b6cc..f7223fc8 100644 --- a/sourcepawn/compiler/libpawnc.cpp +++ b/sourcepawn/compiler/libpawnc.cpp @@ -233,7 +233,10 @@ char *pc_readsrc(void *handle,unsigned char *target,int maxchars) src->pos++; if (outptr < outend) *outptr++ = '\n'; - } + } else { + // Replace with \n. + *(outptr - 1) = '\n'; + } break; } }