U_CHAR *bp;
{
register U_CHAR *p = bp;
- register int count = 0;
/* First count the backslash-newline pairs here. */
- while (1) {
- if (p[0] == '\\') {
- if (p[1] == '\n')
- p += 2, count++;
- else if (p[1] == '\r' && p[2] == '\n')
- p += 3, count++;
- else
- break;
- } else
- break;
- }
+ while (p[0] == '\\' && p[1] == '\n')
+ p += 2;
/* What follows the backslash-newlines is not embarrassing. */
- if (count == 0 || (*p != '/' && *p != '*'))
+ if (*p != '/' && *p != '*')
return;
/* Copy all potentially embarrassing characters
*bp++ = *p++;
/* Now write the same number of pairs after the embarrassing chars. */
- while (count-- > 0) {
+ while (bp < p) {
*bp++ = '\\';
*bp++ = '\n';
}
U_CHAR *bp;
{
register U_CHAR *p = bp;
- register int count = 0;
/* First count the backslash-newline pairs here. */
- while (1) {
- if (p[0] == '\\') {
- if (p[1] == '\n')
- p += 2, count++;
- else if (p[1] == '\r' && p[2] == '\n')
- p += 3, count++;
- else
- break;
- } else
- break;
- }
+ while (p[0] == '\\' && p[1] == '\n')
+ p += 2;
/* What follows the backslash-newlines is not embarrassing. */
- if (count == 0 || !is_idchar[*p])
+ if (!is_idchar[*p])
return;
/* Copy all potentially embarrassing characters
*bp++ = *p++;
/* Now write the same number of pairs after the embarrassing chars. */
- while (count-- > 0) {
+ while (bp < p) {
*bp++ = '\\';
*bp++ = '\n';
}