else
{
UErrorCode status = U_ZERO_ERROR;
- int32_t size = 0;
int32_t lsize = 0;
int32_t csize = 0;
int32_t vsize = 0;
int32_t ksize = 0;
- // Calculate the size of the resulting string.
+ // Check the sizes of the input strings.
// Language
if ( newLanguage != NULL )
setToBogus();
return;
}
- size = lsize;
}
CharString togo(newLanguage, lsize, status); // start with newLanguage
setToBogus();
return;
}
- size += csize;
}
// _Variant
}
}
- if( vsize > 0 )
- {
- size += vsize;
- }
-
- // Separator rules:
- if ( vsize > 0 )
- {
- size += 2; // at least: __v
- }
- else if ( csize > 0 )
- {
- size += 1; // at least: _v
- }
-
if ( newKeywords != NULL)
{
ksize = (int32_t)uprv_strlen(newKeywords);
setToBogus();
return;
}
- size += ksize + 1;
}
- // NOW we have the full locale string..
- // Now, copy it back.
+ // We've checked the input sizes, now build up the full locale string..
// newLanguage is already copied