diff options
author | Gary Houston <ghouston@arglist.com> | 1996-09-28 19:40:54 +0000 |
---|---|---|
committer | Gary Houston <ghouston@arglist.com> | 1996-09-28 19:40:54 +0000 |
commit | dbece3a2044c38c7a9c18014cf8d9162d2787b62 (patch) | |
tree | a0826f6a8bbbc42e087137171ed69ece193a0baa | |
parent | 5552355a7bf0e34dd9eee54c7384114295b96d7a (diff) | |
download | guile-dbece3a2044c38c7a9c18014cf8d9162d2787b62.tar.gz |
* strings.c, strings.h: (scm_makfrom0str, scm_makefrom0str_opt:
declare the char * to be const. Avoids a warning in rgx.c.
* ports.h: spelling fix.
* filesys.c (scm_sys_stat, scm_sys,lstat): include file name in
error messages.
* load.c (scm_sys_try_load_path): throw an error if file not found
(like it says it in NEWS).
-rw-r--r-- | libguile/ChangeLog | 13 | ||||
-rw-r--r-- | libguile/filesys.c | 10 | ||||
-rw-r--r-- | libguile/load.c | 14 | ||||
-rw-r--r-- | libguile/ports.h | 2 | ||||
-rw-r--r-- | libguile/strings.c | 8 | ||||
-rw-r--r-- | libguile/strings.h | 4 |
6 files changed, 37 insertions, 14 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 1bde313a9..bb31a8cfc 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,16 @@ +Sat Sep 28 02:07:43 1996 Gary Houston <ghouston@actrix.gen.nz> + + * strings.c, strings.h: (scm_makfrom0str, scm_makefrom0str_opt: + declare the char * to be const. Avoids a warning in rgx.c. + + * ports.h: spelling fix. + + * filesys.c (scm_sys_stat, scm_sys,lstat): include file name in + error messages. + + * load.c (scm_sys_try_load_path): throw an error if file not found + (like it says it in NEWS). + Tue Sep 24 06:48:38 1996 Gary Houston <ghouston@actrix.gen.nz> * load.c (scm_sys_try_load): don't check whether value returned diff --git a/libguile/filesys.c b/libguile/filesys.c index 63f93fbc4..425d70ca2 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -615,7 +615,10 @@ scm_sys_stat (fd_or_path) } if (rv != 0) - scm_syserror (s_sys_stat); + scm_syserror_msg (s_sys_stat, "%s: %S", + scm_listify (scm_makfrom0str (strerror (errno)), + fd_or_path, + SCM_UNDEFINED)); return scm_stat2scm (&stat_temp); } @@ -1180,7 +1183,10 @@ scm_sys_lstat(str) SCM_ASSERT(SCM_NIMP(str) && SCM_STRINGP(str), str, (char *)SCM_ARG1, s_sys_lstat); SCM_SYSCALL(rv = lstat(SCM_CHARS(str), &stat_temp)); if (rv != 0) - scm_syserror (s_sys_lstat); + scm_syserror_msg (s_sys_lstat, "%s: %S", + scm_listify (scm_makfrom0str (strerror (errno)), + str, + SCM_UNDEFINED)); return scm_stat2scm(&stat_temp); #else scm_sysmissing (s_sys_lstat); diff --git a/libguile/load.c b/libguile/load.c index bbf86bbee..f21e614cc 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -205,11 +205,15 @@ scm_sys_try_load_path (filename, case_insensitive_p, sharp) SCM sharp; { SCM full_filename = scm_sys_search_load_path (filename); - - if (SCM_NIMP (full_filename) && SCM_ROSTRINGP (full_filename)) - return scm_sys_try_load (full_filename, case_insensitive_p, sharp); - else - return scm_sys_try_load (filename, case_insensitive_p, sharp); + if (SCM_FALSEP (full_filename)) + { + lgh_error (scm_misc_error_key, + s_sys_try_load_path, + "Unable to find file %S in %S", + scm_listify (filename, *scm_loc_load_path, SCM_UNDEFINED), + SCM_BOOL_F); + } + return scm_sys_try_load (full_filename, case_insensitive_p, sharp); } diff --git a/libguile/ports.h b/libguile/ports.h index 2f0d23213..4cbba8ea1 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -87,7 +87,7 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table. */ /* PORT FLAGS - * A set of flags caracterizes a port. + * A set of flags characterizes a port. */ #define SCM_OPN (1L<<16) /* Is the port open? */ #define SCM_RDNG (2L<<16) /* Is it a readable port? */ diff --git a/libguile/strings.c b/libguile/strings.c index 4472dca89..5cab941fc 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -234,11 +234,11 @@ scm_makfromstr (src, len, slots) #ifdef __STDC__ SCM -scm_makfrom0str (char *src) +scm_makfrom0str (const char *src) #else SCM scm_makfrom0str (src) - char *src; + const char *src; #endif { if (!src) return SCM_BOOL_F; @@ -247,11 +247,11 @@ scm_makfrom0str (src) #ifdef __STDC__ SCM -scm_makfrom0str_opt (char *src) +scm_makfrom0str_opt (const char *src) #else SCM scm_makfrom0str_opt (src) - char *src; + const char *src; #endif { return scm_makfrom0str (src); diff --git a/libguile/strings.h b/libguile/strings.h index 22b3354e4..e122d1af9 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -65,8 +65,8 @@ extern SCM scm_makstr (long len, int slots); extern SCM scm_makfromstrs (int argc, char **argv); extern SCM scm_take0str (char * it); extern SCM scm_makfromstr (const char *src, scm_sizet len, int slots); -extern SCM scm_makfrom0str (char *src); -extern SCM scm_makfrom0str_opt (char *src); +extern SCM scm_makfrom0str (const char *src); +extern SCM scm_makfrom0str_opt (const char *src); extern SCM scm_make_string (SCM k, SCM chr); extern SCM scm_string_length (SCM str); extern SCM scm_string_ref (SCM str, SCM k); |