From fcf19553dd5a5d16e147feb05b9b4d193b022c47 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Wed, 20 Dec 2017 20:23:43 -0800 Subject: [PATCH] cleanup of stuff, nothing. --- inxi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 0587472..f86c1da 100755 --- a/inxi +++ b/inxi @@ -3724,6 +3724,15 @@ get_cmdline() ##print_screen_output "Marker" ##print_screen_output "\$ppid='$ppid' -=- $(< /proc/$ppid/cmdline)" unset A_CMDL + # http://transnum.blogspot.com/2008/11/bashs-read-built-in-supports-0-as.html +# Because BASH internally uses C-style strings, in which '\0' is the terminator, +# read -d $'\0' is essentially equivalent to read -d ''. This is why I believed +# read did not accept null-delimited strings. However, it turns out that BASH +# actually handles this correctly. +# I checked BASH’s source code and found the delimiter was simply determined by +# delim = *list_optarg; (bash-3.2/builtins/read.def, line 296) where list_optarg +# points to the argument following -d. Therefore, it makes no difference to the +# value of delim whether $'\0' or '' is used. ## note: need to figure this one out, and ideally clean it up and make it readable while read -d $'\0' L && [[ $i -lt 32 ]] do @@ -3897,7 +3906,7 @@ get_irc_client_version() # the hexchat author decided to make --version/-v return a gtk dialogue box, lol... # so we need to read the actual config file for hexchat. Note that older hexchats # used xchat config file, so test first for default, then legacy. Because it's possible - # for this file to be use edited, doing some extra checks here. + # for this file to be user edited, doing some extra checks here. if [[ -f ~/.config/hexchat/hexchat.conf ]];then file_data="$( cat ~/.config/hexchat/hexchat.conf )" elif [[ -f ~/.config/hexchat/xchat.conf ]];then