1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Removed dead code

If `emesg` is `Qundef`, it is not a message string and then `elen`
(the length of the message) is 0.  So `emesg` cannot be `Qundef` in
the `elen != 0` block.  Pointed out by Coverity Scan.
This commit is contained in:
Nobuyoshi Nakada 2019-07-15 16:44:07 +09:00
parent de0f192444
commit 5e0d27a32f
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -169,9 +169,10 @@ print_errinfo(const VALUE eclass, const VALUE errat, const VALUE emesg, const VA
write_warn(str, "\n");
}
else {
/* emesg is a String instance */
const char *tail = 0;
if (emesg == Qundef && highlight) write_warn(str, bold);
if (highlight) write_warn(str, bold);
if (RSTRING_PTR(epath)[0] == '#')
epath = 0;
if ((tail = memchr(einfo, '\n', elen)) != 0) {