Improved gmi2map logic

This commit is contained in:
Luxferre
2023-04-03 21:37:12 +03:00
parent aa3a252203
commit 8060459dc7
2 changed files with 13 additions and 10 deletions
+4 -1
View File
@@ -22,8 +22,11 @@ CRLF=$'\r\n'
[[ -z "$TSPACES" ]] && TSPACES=0
[[ -z "$DELIM" ]] && DELIM=';'
FORMAT_WIDTH=0 # make formatting width distinct from the target reflow width
(( TSPACES > 0 )) && FORMAT_WIDTH="$TARGET_WIDTH" # and only use it if there are trailing spaces
# format strings to use in different situations:
reflowfmt="%-$(( LSPACES ))s%-${TARGET_WIDTH}s%-$(( TSPACES ))s\n" # params: smth, line, smth
reflowfmt="%-$(( LSPACES ))s%-${FORMAT_WIDTH}s%-$(( TSPACES ))s\n" # params: smth, line, smth
infofmt="i%s${TAB}%s${TAB}%s${TAB}0${CRLF}" # params: line, DELIM, DELIM
gopherlinkfmt="%s%s${TAB}%s${TAB}%s${TAB}%d${CRLF}" # params: type, name, selector, host, port
extlinkfmt="h%s${TAB}URL:%s${TAB}%s${TAB}0${CRLF}" # params: name, URL, DELIM