Menu

#2209 gnuplot-5.2.7/src/readline.c:455: possible missing break ?

None
closed-fixed
nobody
None
2019-12-03
2019-10-21
dcb
No

gnuplot-5.2.7/src/readline.c:455:8: warning: Variable 'width' is reassigned a value before the old one has been used. 'break;' missing?

Source code is

    } else if ((ch & 0xF8) == 0xF0) {
        i += 3;
    }
    width += mbwidth(&ch);
}
case S_ENC_SJIS:
    /* Assume all double-byte characters have double-width. */
    width = gp_strlen(str);
    break;

Discussion

  • Ethan Merritt

    Ethan Merritt - 2019-10-21

    This is a case of one bug partially cancelling a second bug. Yes there is a missing "break". But the preceding code was broken, while falling through kinda-sorta worked for plain text (no eight bit characters). Now fixed for linux + UTF8 encoding. Untested on Windows but I don't think this code path is ever used on Windows (not 100% sure).

    Note that this is only relevant to configuration --with-readline=builtin

     
  • Ethan Merritt

    Ethan Merritt - 2019-10-21
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2019-12-03
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB