comparison src/fileio.c @ 5835:e24390bd4235

Fix off-by-one error in Ffile_truename. See <CAHCOHQnOwYH5kF0mq6184Fetuus-KOeKNUpTHYXhq56AvcuE9A@mail.gmail.com> in xemacs-patches.
author Jerry James <james@xemacs.org>
date Fri, 05 Dec 2014 16:56:13 -0700
parents a216b3c2b09e
children
comparison
equal deleted inserted replaced
5834:7984e732829e 5835:e24390bd4235
1464 Lisp_Object resolved_name; 1464 Lisp_Object resolved_name;
1465 int rlen = qxestrlen (resolved_path); 1465 int rlen = qxestrlen (resolved_path);
1466 if (elen > 0 && IS_DIRECTORY_SEP (string_byte (expanded_name, elen - 1)) 1466 if (elen > 0 && IS_DIRECTORY_SEP (string_byte (expanded_name, elen - 1))
1467 && !(rlen > 0 && IS_DIRECTORY_SEP (resolved_path[rlen - 1]))) 1467 && !(rlen > 0 && IS_DIRECTORY_SEP (resolved_path[rlen - 1])))
1468 { 1468 {
1469 if (rlen + 1 > countof (resolved_path)) 1469 if (rlen + 1 >= countof (resolved_path))
1470 goto toolong; 1470 goto toolong;
1471 resolved_path[rlen++] = DIRECTORY_SEP; 1471 resolved_path[rlen++] = DIRECTORY_SEP;
1472 resolved_path[rlen] = '\0'; 1472 resolved_path[rlen] = '\0';
1473 } 1473 }
1474 resolved_name = make_string (resolved_path, rlen); 1474 resolved_name = make_string (resolved_path, rlen);