8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 475663f commit b3b63deCopy full SHA for b3b63de
ruby.c
@@ -2562,9 +2562,16 @@ load_file_internal(VALUE argp_v)
2562
}
2563
2564
start_read:
2565
- str += len - 1;
2566
- if (*str == '\n') *str-- = '\0';
2567
- if (*str == '\r') *str-- = '\0';
+ if (str[len-1] == '\n') {
+ str[len-1] = '\0';
+ }
2568
+ if (str[len-1] == '\r') {
2569
2570
2571
+ if (str[len-1] != '\0') {
2572
+ str += len - 1;
2573
2574
2575
/* ruby_engine should not contain a space */
2576
if ((p = strstr(p, " -")) != 0) {
2577
opt->warning = 0;
0 commit comments