diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-08-09 06:28:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-08-09 06:28:58 -0700 |
commit | a5e69db365a98857ac2594590614a981d5f9ae74 (patch) | |
tree | b55fcc2b4ed6ee7bb6e645f861e0c47efaee601e /stream.h | |
parent | 9a067618e82ca2a34960376725952c3439db6fa0 (diff) | |
download | txr-a5e69db365a98857ac2594590614a981d5f9ae74.tar.gz txr-a5e69db365a98857ac2594590614a981d5f9ae74.tar.bz2 txr-a5e69db365a98857ac2594590614a981d5f9ae74.zip |
base-name: optionally remove suffix.
The base-name function now takes a second argument which is
optional, specifying a suffix to be removed. The behavior is
similar to that of the second argument of the POSIX basename
command.
* stream.c (base_name): Second argument added. If present, the
returned value is adjusted by trimming the suffix, unless that
would cause an empty string to be returned.
(stream_init): Update registration of base-name intrinsic.
* stream.h (base_name): Declaration updated.
* txr.1: New base-name parameter documented.
Diffstat (limited to 'stream.h')
-rw-r--r-- | stream.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -236,7 +236,7 @@ val remove_path(val path, val throw_on_error); val rename_path(val from, val to); val abs_path_p(val path); val pure_rel_path_p(val path); -val base_name(val path); +val base_name(val path, val suff); val dir_name(val path); val path_cat(val dir_name, val base_name); val make_byte_input_stream(val obj); |