Bug 219493 - nsPersistentProperties doesn't handle multi-line properties

files correctly. This is a better patch than the original one.
r=darin@meer.net, sr=alecf@flett.org
This commit is contained in:
pkw%us.ibm.com 2003-09-25 16:28:06 +00:00
Родитель c10139c9e4
Коммит bbef938929
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -186,7 +186,15 @@ nsPersistentProperties::Load(nsIInputStream *aIn)
switch(c) {
case '\r':
case '\n':
c = SkipWhiteSpace(c);
// Only skip first EOL characters and then next line's
// whitespace characters. Skipping all EOL characters
// and all upcoming whitespace is too agressive.
if (c == '\r')
c = Read();
if (c == '\n')
c = Read();
while (c == ' ' || c == '\t')
c = Read();
continue;
case 'u':
case 'U':
@ -375,7 +383,7 @@ nsPersistentProperties::Read()
PRInt32
nsPersistentProperties::SkipWhiteSpace(PRInt32 c)
{
while ((c >= 0) && IS_WHITE_SPACE(c)) {
while (IS_WHITE_SPACE(c)) {
c = Read();
}