summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2024-04-19 01:06:37 +0200
committerLudovic Courtès <ludo@gnu.org>2024-04-29 23:56:29 +0200
commit5f03cfacd87f4ee1d978407cbd8bb266a25a7098 (patch)
tree7026d493c20d92810ff6a5d6ddf8ec8b12fe740f
parent44c8ce8334ade3612747d72784fa4af9fdaa71f4 (diff)
downloadguix-5f03cfacd87f4ee1d978407cbd8bb266a25a7098.tar.gz
import: beautify-description: Fix ". ." case.
* guix/import/utils.scm (beautify-description): Ensure the matched
string pre is long enough not to fail.

Change-Id: I3172d9a41350b98222cd9ab758487485f26650b3
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/import/utils.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 0cf52cdbde..09a01cf315 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -380,9 +380,10 @@ LENGTH characters."
                                                       (abbrevs '("Dr" "Mr" "Mrs"
                                                                  "Ms" "Prof" "vs"
                                                                  "e.g")))
-                                                  (if (or (any (cut string-suffix? <> pre) abbrevs)
-                                                          (char-upper-case?
-                                                           (string-ref pre (1- (string-length pre)))))
+                                                  (if (and (> (string-length pre) 0)
+                                                           (or (any (cut string-suffix? <> pre) abbrevs)
+                                                               (char-upper-case?
+                                                                (string-ref pre (1- (string-length pre))))))
                                                       ". "
                                                       ".  ")))
                                               'post)