Skip to content

Commit

Permalink
history: work around possible dirty prefix * in the history output
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jul 28, 2022
1 parent 6498a5d commit cc14f59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ble-edit.sh
Expand Up @@ -4737,7 +4737,7 @@ else
builtin history -p -- '' &>/dev/null
ble/util/assign line2 'HISTTIMEFORMAT= builtin history 1'
if [[ $line1 != "$line2" ]]; then
local rex_head='^[[:space:]]*[0-9]+[[:space:]]*'
local rex_head='^[[:space:]]*[0-9]+\*?[[:space:]]*'
[[ $line1 =~ $rex_head ]] &&
line1=${line1:${#BASH_REMATCH}}

Expand Down Expand Up @@ -5112,6 +5112,7 @@ function ble-edit/history/get-count {
local history_line
ble/util/assign history_line 'builtin history 1'
ble/string#split-words history_line "$history_line"
history_line=${history_line/'*'}
_ble_edit_history_count=${history_line[0]}
fi
_ret=$_ble_edit_history_count
Expand Down

0 comments on commit cc14f59

Please sign in to comment.