diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-03 13:14:44 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-10 19:39:58 -0700 |
commit | e852a6f716fa947f95725cdd28e2123d055fd18b (patch) | |
tree | f142094ce946a8cbc8f31252dbfadda11d885da4 /src/property/hostname.lisp | |
parent | 9533d3dde13d3ca06301514398551b90d291586e (diff) | |
download | consfigurator-e852a6f716fa947f95725cdd28e2123d055fd18b.tar.gz |
HOSTNAME::DOMAIN: fix handling hostnames without any '.'
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/hostname.lisp')
-rw-r--r-- | src/property/hostname.lisp | 4 |
1 files changed, 3 insertions, 1 deletions
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. |