1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 14:21:10 +02:00

* 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).
This commit is contained in:
Gary Houston 1996-09-28 19:40:54 +00:00
parent 5552355a7b
commit dbece3a204
6 changed files with 37 additions and 14 deletions

View file

@ -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> 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 * load.c (scm_sys_try_load): don't check whether value returned

View file

@ -615,7 +615,10 @@ scm_sys_stat (fd_or_path)
} }
if (rv != 0) 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); 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_ASSERT(SCM_NIMP(str) && SCM_STRINGP(str), str, (char *)SCM_ARG1, s_sys_lstat);
SCM_SYSCALL(rv = lstat(SCM_CHARS(str), &stat_temp)); SCM_SYSCALL(rv = lstat(SCM_CHARS(str), &stat_temp));
if (rv != 0) 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); return scm_stat2scm(&stat_temp);
#else #else
scm_sysmissing (s_sys_lstat); scm_sysmissing (s_sys_lstat);

View file

@ -205,11 +205,15 @@ scm_sys_try_load_path (filename, case_insensitive_p, sharp)
SCM sharp; SCM sharp;
{ {
SCM full_filename = scm_sys_search_load_path (filename); SCM full_filename = scm_sys_search_load_path (filename);
if (SCM_FALSEP (full_filename))
if (SCM_NIMP (full_filename) && SCM_ROSTRINGP (full_filename)) {
return scm_sys_try_load (full_filename, case_insensitive_p, sharp); lgh_error (scm_misc_error_key,
else s_sys_try_load_path,
return scm_sys_try_load (filename, case_insensitive_p, sharp); "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);
} }

View file

@ -87,7 +87,7 @@ extern int scm_port_table_size; /* Number of ports in scm_port_table. */
/* PORT FLAGS /* 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_OPN (1L<<16) /* Is the port open? */
#define SCM_RDNG (2L<<16) /* Is it a readable port? */ #define SCM_RDNG (2L<<16) /* Is it a readable port? */

View file

@ -234,11 +234,11 @@ scm_makfromstr (src, len, slots)
#ifdef __STDC__ #ifdef __STDC__
SCM SCM
scm_makfrom0str (char *src) scm_makfrom0str (const char *src)
#else #else
SCM SCM
scm_makfrom0str (src) scm_makfrom0str (src)
char *src; const char *src;
#endif #endif
{ {
if (!src) return SCM_BOOL_F; if (!src) return SCM_BOOL_F;
@ -247,11 +247,11 @@ scm_makfrom0str (src)
#ifdef __STDC__ #ifdef __STDC__
SCM SCM
scm_makfrom0str_opt (char *src) scm_makfrom0str_opt (const char *src)
#else #else
SCM SCM
scm_makfrom0str_opt (src) scm_makfrom0str_opt (src)
char *src; const char *src;
#endif #endif
{ {
return scm_makfrom0str (src); return scm_makfrom0str (src);

View file

@ -65,8 +65,8 @@ extern SCM scm_makstr (long len, int slots);
extern SCM scm_makfromstrs (int argc, char **argv); extern SCM scm_makfromstrs (int argc, char **argv);
extern SCM scm_take0str (char * it); extern SCM scm_take0str (char * it);
extern SCM scm_makfromstr (const char *src, scm_sizet len, int slots); extern SCM scm_makfromstr (const char *src, scm_sizet len, int slots);
extern SCM scm_makfrom0str (char *src); extern SCM scm_makfrom0str (const char *src);
extern SCM scm_makfrom0str_opt (char *src); extern SCM scm_makfrom0str_opt (const char *src);
extern SCM scm_make_string (SCM k, SCM chr); extern SCM scm_make_string (SCM k, SCM chr);
extern SCM scm_string_length (SCM str); extern SCM scm_string_length (SCM str);
extern SCM scm_string_ref (SCM str, SCM k); extern SCM scm_string_ref (SCM str, SCM k);