[hackers] [libgrapheme] Fix a few small errors in the to_case.sh-template || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Wed, 7 Sep 2022 22:20:35 +0200 (CEST)

commit 5b5c8e0a8390f87bcaa8c28dadaa625cede42690
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Wed Sep 7 22:20:21 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Wed Sep 7 22:20:21 2022 +0200

    Fix a few small errors in the to_case.sh-template
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/man/template/to_case.sh b/man/template/to_case.sh
index 522571e..89b8996 100644
--- a/man/template/to_case.sh
+++ b/man/template/to_case.sh
_AT_@ -1,10 +1,12 @@
 if [ "$ENCODING" = "utf8" ]; then
         UNIT="byte"
+ ARRAYTYPE="UTF-8-encoded string"
         SUFFIX="_utf8"
         ANTISUFFIX=""
         DATATYPE="char"
 else
         UNIT="codepoint"
+ ARRAYTYPE="codepoint array"
         SUFFIX=""
         ANTISUFFIX="_utf8"
         DATATYPE="uint_least32_t"
_AT_@ -16,7 +18,7 @@ cat << EOF
 .Os suckless.org
 .Sh NAME
 .Nm grapheme_to_${CASE}${SUFFIX}
-.Nd convert codepoint array to ${CASE}
+.Nd convert ${ARRAYTYPE} to ${CASE}
 .Sh SYNOPSIS
 .In grapheme.h
 .Ft size_t
_AT_@ -24,7 +26,7 @@ cat << EOF
 .Sh DESCRIPTION
 The
 .Fn grapheme_to_${CASE}${SUFFIX}
-function converts the $(if [ "$ENCODING" = "utf8" ]; then printf "UTF-8-encoded string"; else printf "codepoint array"; fi)
+function converts the ${ARRAYTYPE}
 .Va str
 to ${CASE} and writes the result to
 .Va dest
_AT_@ -39,13 +41,13 @@ If
 .Va len
 is set to
 .Dv SIZE_MAX
-(stdint.h is already included by grapheme.h) the string
+(stdint.h is already included by grapheme.h) the ${ARRAYTYPE}
 .Va src
 is interpreted to be NUL-terminated and processing stops when a
 NUL-byte is encountered.
 .Pp
 For $(if [ "$ENCODING" != "utf8" ]; then printf "UTF-8-encoded"; else printf "non-UTF-8"; fi) input data
-.Xr grapheme_to_${ANTISUFFIX} 3
+.Xr grapheme_to_${CASE}${ANTISUFFIX} 3
 can be used instead.
 .Sh RETURN VALUES
 The
_AT_@ -60,7 +62,7 @@ is not large enough or
 is
 .Dv NULL .
 .Sh SEE ALSO
-.Xr grapheme_to_${ANTISUFFIX} 3 ,
+.Xr grapheme_to_${CASE}${ANTISUFFIX} 3 ,
 .Xr libgrapheme 7
 .Sh STANDARDS
 .Fn grapheme_to_${CASE}${SUFFIX}
Received on Wed Sep 07 2022 - 22:20:35 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 07 2022 - 22:24:37 CEST