diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-08-27 12:45:37 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-08-27 12:45:37 +0000 |
commit | 2616f0e0ce8348bb308522655f14f0318e7ee308 (patch) | |
tree | e8b9551e9b8a6ec70989a66c27ec7ce0eccd4972 /libguile/strings.c | |
parent | 685777ca1813c7899de6110a29d29070f1c2684b (diff) | |
download | guile-2616f0e0ce8348bb308522655f14f0318e7ee308.tar.gz |
(SCM_STRINGP): Accept all strings.
(SCM_STRING_CHARS): Reject shared substrings here.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r-- | libguile/strings.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libguile/strings.c b/libguile/strings.c index 6feb017de..9c1057833 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -927,11 +927,7 @@ SCM_STRINGP (SCM str) scm_c_issue_deprecation_warning ("SCM_STRINGP is deprecated. Use scm_is_string instead."); - /* We don't accept shared substrings here since they are not - null-terminated. - */ - - return IS_STRING (str) && !IS_SH_STRING (str); + return scm_is_string (str); } char * @@ -942,7 +938,15 @@ SCM_STRING_CHARS (SCM str) scm_c_issue_deprecation_warning ("SCM_STRING_CHARS is deprecated. See the manual for alternatives."); - /* The following is wrong, of course... + /* We don't accept shared substrings here since they are not + null-terminated. + */ + if (IS_SH_STRING (str)) + scm_misc_error (NULL, + "SCM_STRING_CHARS does not work with shared substrings.", + SCM_EOL); + + /* The following is still wrong, of course... */ chars = scm_i_string_writable_chars (str); scm_i_string_stop_writing (); |