diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/lread.c | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 15feb7427fc..787ab4c045f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 1999-10-18 Kenichi Handa <handa@etl.go.jp> | ||
| 2 | |||
| 3 | * lread.c (Fload): Calculate bytes of filename correctly. | ||
| 4 | (openp): Likewise. | ||
| 5 | |||
| 1 | 1999-10-18 Keisuke Nishida <kxn30@po.cwru.edu> | 6 | 1999-10-18 Keisuke Nishida <kxn30@po.cwru.edu> |
| 2 | 7 | ||
| 3 | * print.c (print_preprocess): In case print-circle is nil, | 8 | * print.c (print_preprocess): In case print-circle is nil, |
diff --git a/src/lread.c b/src/lread.c index b57223b8cf8..c14554f5b31 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -625,7 +625,7 @@ Return t if file exists.") | |||
| 625 | since it would try to load a directory as a Lisp file */ | 625 | since it would try to load a directory as a Lisp file */ |
| 626 | if (XSTRING (file)->size > 0) | 626 | if (XSTRING (file)->size > 0) |
| 627 | { | 627 | { |
| 628 | int size = XSTRING (file)->size; | 628 | int size = STRING_BYTES (XSTRING (file)); |
| 629 | 629 | ||
| 630 | GCPRO1 (file); | 630 | GCPRO1 (file); |
| 631 | 631 | ||
| @@ -681,7 +681,7 @@ Return t if file exists.") | |||
| 681 | 681 | ||
| 682 | /* Load .elc files directly, but not when they are | 682 | /* Load .elc files directly, but not when they are |
| 683 | remote and have no handler! */ | 683 | remote and have no handler! */ |
| 684 | if (!bcmp (&(XSTRING (found)->data[XSTRING (found)->size - 4]), | 684 | if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]), |
| 685 | ".elc", 4) | 685 | ".elc", 4) |
| 686 | && fd != 0) | 686 | && fd != 0) |
| 687 | { | 687 | { |
| @@ -694,7 +694,7 @@ Return t if file exists.") | |||
| 694 | fmode = "rb"; | 694 | fmode = "rb"; |
| 695 | #endif /* DOS_NT */ | 695 | #endif /* DOS_NT */ |
| 696 | stat ((char *)XSTRING (found)->data, &s1); | 696 | stat ((char *)XSTRING (found)->data, &s1); |
| 697 | XSTRING (found)->data[XSTRING (found)->size - 1] = 0; | 697 | XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 1] = 0; |
| 698 | result = stat ((char *)XSTRING (found)->data, &s2); | 698 | result = stat ((char *)XSTRING (found)->data, &s2); |
| 699 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) | 699 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) |
| 700 | { | 700 | { |
| @@ -706,7 +706,7 @@ Return t if file exists.") | |||
| 706 | message_with_string ("Source file `%s' newer than byte-compiled file", | 706 | message_with_string ("Source file `%s' newer than byte-compiled file", |
| 707 | found, 1); | 707 | found, 1); |
| 708 | } | 708 | } |
| 709 | XSTRING (found)->data[XSTRING (found)->size - 1] = 'c'; | 709 | XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 1] = 'c'; |
| 710 | } | 710 | } |
| 711 | else | 711 | else |
| 712 | { | 712 | { |
| @@ -897,7 +897,7 @@ openp (path, str, suffix, storeptr, exec_only) | |||
| 897 | 897 | ||
| 898 | /* Calculate maximum size of any filename made from | 898 | /* Calculate maximum size of any filename made from |
| 899 | this path element/specified file name and any possible suffix. */ | 899 | this path element/specified file name and any possible suffix. */ |
| 900 | want_size = strlen (suffix) + XSTRING (filename)->size + 1; | 900 | want_size = strlen (suffix) + STRING_BYTES (XSTRING (filename)) + 1; |
| 901 | if (fn_size < want_size) | 901 | if (fn_size < want_size) |
| 902 | fn = (char *) alloca (fn_size = 100 + want_size); | 902 | fn = (char *) alloca (fn_size = 100 + want_size); |
| 903 | 903 | ||
| @@ -917,13 +917,14 @@ openp (path, str, suffix, storeptr, exec_only) | |||
| 917 | && XSTRING (filename)->data[1] == ':') | 917 | && XSTRING (filename)->data[1] == ':') |
| 918 | { | 918 | { |
| 919 | strncpy (fn, XSTRING (filename)->data + 2, | 919 | strncpy (fn, XSTRING (filename)->data + 2, |
| 920 | XSTRING (filename)->size - 2); | 920 | STRING_BYTES (XSTRING (filename)) - 2); |
| 921 | fn[XSTRING (filename)->size - 2] = 0; | 921 | fn[STRING_BYTES (XSTRING (filename)) - 2] = 0; |
| 922 | } | 922 | } |
| 923 | else | 923 | else |
| 924 | { | 924 | { |
| 925 | strncpy (fn, XSTRING (filename)->data, XSTRING (filename)->size); | 925 | strncpy (fn, XSTRING (filename)->data, |
| 926 | fn[XSTRING (filename)->size] = 0; | 926 | STRING_BYTES (XSTRING (filename))); |
| 927 | fn[STRING_BYTES (XSTRING (filename))] = 0; | ||
| 927 | } | 928 | } |
| 928 | 929 | ||
| 929 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ | 930 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ |