aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/package.lisp2
-rw-r--r--src/property/hostname.lisp4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/package.lisp b/src/package.lisp
index 6665a48..bb63089 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -622,7 +622,7 @@
#:u-boot-installed-rockchip))
(defpackage :consfigurator.property.hostname
- (:use #:cl #:consfigurator)
+ (:use #:cl #:alexandria #:consfigurator)
(:local-nicknames (#:cmd #:consfigurator.property.cmd)
(#:container #:consfigurator.property.container)
(#:file #:consfigurator.property.file))
diff --git a/src/property/hostname.lisp b/src/property/hostname.lisp
index 0ff8828..da1610e 100644
--- a/src/property/hostname.lisp
+++ b/src/property/hostname.lisp
@@ -19,7 +19,9 @@
(named-readtables:in-readtable :consfigurator)
(defun domain (hostname)
- (subseq hostname (min (length hostname) (1+ (position #\. hostname)))))
+ (if-let ((pos (position #\. hostname)))
+ (subseq hostname (min (length hostname) (1+ pos)))
+ ""))
(defprop is :posix (hostname)
"Specify that the hostname of this host is HOSTNAME.