2000-06-30 Akira Ohashi <bg66@luck.gr.jp>
authorbg66 <bg66>
Fri, 30 Jun 2000 02:27:51 +0000 (02:27 +0000)
committerbg66 <bg66>
Fri, 30 Jun 2000 02:27:51 +0000 (02:27 +0000)
        * liece-misc.el (liece-server-host):
        When `liece-server' is string return host only.

lisp/liece-misc.el

index 496a372..3603ef6 100644 (file)
 (defmacro liece-server-host ()
   '(if (listp liece-server)
        (plist-get liece-server ':host)
-     liece-server))
+     (if (or (string-match "^\\[\\([^]]+\\)\\]:?[0-9]*" liece-server)
+            (string-match "^\\([^:]+\\):?[0-9]*" liece-server))
+         (match-string 1 liece-server)
+       liece-server)))
 
 (defmacro liece-clean-hostname (hostname)
   "Return the arg HOSTNAME, but if is a dotted-quad, put brackets around it."