зеркало из https://github.com/mozilla/gecko-dev.git
Check for newline at the beginning of the loop. Bug 494098, r=VYV03354@nifty.ne.jp
This commit is contained in:
Родитель
45187f5935
Коммит
99299be406
|
@ -50,6 +50,10 @@ NS_IMETHODIMP nsISO2022KRToUnicode::Convert(const char * aSrc, PRInt32 * aSrcLen
|
|||
PRUnichar* dest = aDest;
|
||||
while((src < srcEnd))
|
||||
{
|
||||
// if LF/CR, return to US-ASCII unconditionally.
|
||||
if ( *src == 0x0a || *src == 0x0d )
|
||||
mState = mState_Init;
|
||||
|
||||
switch(mState)
|
||||
{
|
||||
case mState_Init:
|
||||
|
@ -206,15 +210,13 @@ NS_IMETHODIMP nsISO2022KRToUnicode::Convert(const char * aSrc, PRInt32 * aSrcLen
|
|||
|
||||
} // switch
|
||||
src++;
|
||||
if ( *src == 0x0a || *src == 0x0d ) // if LF/CR, return to US-ASCII unconditionally.
|
||||
mState = mState_Init;
|
||||
}
|
||||
*aDestLen = dest - aDest;
|
||||
return NS_OK;
|
||||
}
|
||||
*aDestLen = dest - aDest;
|
||||
return NS_OK;
|
||||
|
||||
error1:
|
||||
*aDestLen = dest-aDest;
|
||||
*aSrcLen = src-(unsigned char*)aSrc;
|
||||
return NS_OK_UDEC_MOREOUTPUT;
|
||||
*aDestLen = dest-aDest;
|
||||
*aSrcLen = src-(unsigned char*)aSrc;
|
||||
return NS_OK_UDEC_MOREOUTPUT;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче