diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-04-27 19:30:40 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2020-05-03 01:27:36 +0000 |
commit | deca7c928520fba5a73383f1cac0b3ace8e0e45d (patch) | |
tree | 9e8e04cd5fbc8297fb033141ed8b0018b1eb2654 /Src/utils.c | |
parent | 4d2bcf2fe7637b641ccde31a8ca7c4875f0699c1 (diff) | |
download | zsh-deca7c928520fba5a73383f1cac0b3ace8e0e45d.tar.gz zsh-deca7c928520fba5a73383f1cac0b3ace8e0e45d.tar.xz zsh-deca7c928520fba5a73383f1cac0b3ace8e0e45d.zip |
45730: _arguments: Add the -0 flag, which makes $opt_args be populated sanely.
Also, write/extend docstrings for sepjoin() and zjoin().
Diffstat (limited to 'Src/utils.c')
-rw-r--r-- | Src/utils.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Src/utils.c b/Src/utils.c index e258ef836..5158a70b1 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -3596,6 +3596,17 @@ strftimehandling: return buf - origbuf; } +/* + * Return a string consisting of the elements of 'arr' joined by the character + * 'delim', which will be metafied if necessary. The string will be allocated + * on the heap iff 'heap'. + * + * Comparable to: + * + * char metafied_delim[] = { Meta, delim ^ 32, '\0' }; + * sepjoin(arr, metafied_delim, heap) + */ + /**/ mod_export char * zjoin(char **arr, int delim, int heap) @@ -3894,10 +3905,12 @@ wordcount(char *s, char *sep, int mul) /* * 's' is a NULL-terminated array of strings. - * 'sep' is a string. + * 'sep' is a string, or NULL to split on ${IFS[1]}. * * Return a string consisting of the elements of 's' joined by 'sep', * allocated on the heap iff 'heap'. + * + * See also zjoin(). */ /**/ |