From: Thomas Weißschuh Date: Wed, 10 May 2023 10:21:24 +0000 (+0200) Subject: tools: (asciidoctor-unicodeconverter) properly handle dotted commands X-Git-Tag: v2.39~21^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05c7d67dee09e36688b49da62ba381e36f3a9cf5;p=thirdparty%2Futil-linux.git tools: (asciidoctor-unicodeconverter) properly handle dotted commands Split from the end of the docname, as otherwise commands like "fsck.foo" are stripped of their suffix. Signed-off-by: Thomas Weißschuh --- diff --git a/tools/asciidoctor-unicodeconverter.rb b/tools/asciidoctor-unicodeconverter.rb index 7435ed5ffa..2c6fd43ffe 100644 --- a/tools/asciidoctor-unicodeconverter.rb +++ b/tools/asciidoctor-unicodeconverter.rb @@ -12,7 +12,7 @@ module UnicodeConverter def process document, reader lines = reader.read_lines state = BEFORE_NAME_SECTION - command = document.attributes['docname'].split('.', 2)[0] + command = document.attributes['docname'].rpartition('.')[0] lines.map! do |line| if state == IN_NAME_SECTION line.sub! " \u2013 ", " - "