Avoid converting the 'mode' argument of 'open-file'.
authorLudovic Courtès <ludo@gnu.org>
Sun, 11 Jan 2015 19:58:34 +0000 (20:58 +0100)
committerLudovic Courtès <ludo@gnu.org>
Sun, 11 Jan 2015 19:59:03 +0000 (20:59 +0100)
commit37b1453032488de582175270d1b3a1653ea81457
treef7cbbfe710f8cec1a2405f7165664e1a7f640050
parentcdcba5b2f6270de808e51b3b933374170611b91d
Avoid converting the 'mode' argument of 'open-file'.

* libguile/fports.c (scm_open_file_with_encoding): const-qualify 'md'
  and 'ptr'.  Add call to 'scm_i_try_narrow_string'.  Use
  'scm_i_string_chars' instead of 'scm_to_locale_string' plus '
  scm_dynwind_free'.
* test-suite/tests/ports.test ("invalid wide mode string",
  "valid wide mode string"): New tests.
libguile/fports.c
test-suite/tests/ports.test