Small code's simplifying: use issoftcr() in CopyToBuf()
This commit is contained in:
parent
6aa5bd173f
commit
996d97f7b7
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
#include <gmosqsh.h>
|
#include <gmosqsh.h>
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
void SquishArea::lock() {
|
void SquishArea::lock() {
|
||||||
@ -230,7 +230,7 @@ uint CopyToBuf(char* p, char* out, char** end) {
|
|||||||
|
|
||||||
uint len = 1;
|
uint len = 1;
|
||||||
|
|
||||||
while((*p==CR) or (*p==LF) or (not WideDispsoftcr and *p==SOFTCR))
|
while((*p==CR) or (*p==LF) or issoftcr(*p))
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
while((*p==CTRL_A) or (strncmp(p, "AREA:", 5)==0)) {
|
while((*p==CTRL_A) or (strncmp(p, "AREA:", 5)==0)) {
|
||||||
@ -239,7 +239,7 @@ uint CopyToBuf(char* p, char* out, char** end) {
|
|||||||
if(*p == CTRL_A)
|
if(*p == CTRL_A)
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
while(*p and (*p != CR) and (*p != LF) and (WideDispsoftcr or *p!=SOFTCR)) {
|
while(*p and (*p != CR) and (*p != LF) and !issoftcr(*p)) {
|
||||||
if(out)
|
if(out)
|
||||||
*out++ = *p;
|
*out++ = *p;
|
||||||
len++;
|
len++;
|
||||||
@ -251,11 +251,11 @@ uint CopyToBuf(char* p, char* out, char** end) {
|
|||||||
|
|
||||||
len++;
|
len++;
|
||||||
|
|
||||||
while((*p==LF) or (not WideDispsoftcr and *p==SOFTCR))
|
while((*p==LF) or issoftcr(*p))
|
||||||
p++;
|
p++;
|
||||||
if(*p == CR)
|
if(*p == CR)
|
||||||
p++;
|
p++;
|
||||||
while((*p==LF) or (not WideDispsoftcr and *p==SOFTCR))
|
while((*p==LF) or issoftcr(*p))
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,12 +268,12 @@ uint CopyToBuf(char* p, char* out, char** end) {
|
|||||||
// Make sure to leave no trailing CTRL_A's.
|
// Make sure to leave no trailing CTRL_A's.
|
||||||
if(out and (out[-1]==CTRL_A))
|
if(out and (out[-1]==CTRL_A))
|
||||||
out[-1] = NUL;
|
out[-1] = NUL;
|
||||||
|
|
||||||
|
|
||||||
// Now store the new end location of the kludge lines
|
// Now store the new end location of the kludge lines
|
||||||
if(end)
|
if(end)
|
||||||
*end = p;
|
*end = p;
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user