You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic in cupstestppd.c:check_basics is incorrect.
Following the logic in the source code, the first line ending it will come across in a Windows or Mac file is a carriage return. If the next character is a line feed, then the this character is discarded from the input stream and the variable eol is set to EOL_CRLF, otherwise it is set to EOL_CR.
The next time the a carriage return is encountered in the input stream, the variable 'mixed' is set to 1 because 'eol' is not equal to EOL_NONE, even though the line ending may be legitimate. Ideally, 'mixed' should only be set if the current line's ending is DIFFERENT from what is stored in 'eol', not if an 'eol' has already been detected.
Basically, the first line's ending is detected correctly, but the second line's ending triggers 'mixed = 1;' simply because 'eol != EOL_NONE'.
This only affects CRLF and CR line endings because the LF line endings have an additional conditional before setting 'mixed = 1'; and this conditional should be applied to CRLF and CR as well.
Attached is my proposed fix that works logically in my head but I have not compiled or tested it.
The text was updated successfully, but these errors were encountered:
Version: 1.3-current
CUPS.org User: DavidG
The logic in cupstestppd.c:check_basics is incorrect.
Following the logic in the source code, the first line ending it will come across in a Windows or Mac file is a carriage return. If the next character is a line feed, then the this character is discarded from the input stream and the variable eol is set to EOL_CRLF, otherwise it is set to EOL_CR.
The next time the a carriage return is encountered in the input stream, the variable 'mixed' is set to 1 because 'eol' is not equal to EOL_NONE, even though the line ending may be legitimate. Ideally, 'mixed' should only be set if the current line's ending is DIFFERENT from what is stored in 'eol', not if an 'eol' has already been detected.
Basically, the first line's ending is detected correctly, but the second line's ending triggers 'mixed = 1;' simply because 'eol != EOL_NONE'.
This only affects CRLF and CR line endings because the LF line endings have an additional conditional before setting 'mixed = 1'; and this conditional should be applied to CRLF and CR as well.
Attached is my proposed fix that works logically in my head but I have not compiled or tested it.
The text was updated successfully, but these errors were encountered: