diff options
| author | Michael Albinus | 2009-01-03 14:55:10 +0000 |
|---|---|---|
| committer | Michael Albinus | 2009-01-03 14:55:10 +0000 |
| commit | d665fff055b1da90e5b7636e145b55a2cd0d68da (patch) | |
| tree | 28387cd6184a489a9f23416edb505b2d8e575411 | |
| parent | a6d46bc12c9a4e741570412fb55c4798e9fd75a6 (diff) | |
| download | emacs-d665fff055b1da90e5b7636e145b55a2cd0d68da.tar.gz emacs-d665fff055b1da90e5b7636e145b55a2cd0d68da.zip | |
* net/dbus.el (dbus-string-to-byte-array): Handle empty array.
| -rw-r--r-- | lisp/net/dbus.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 13c2d39f6dd..ee20db9ac34 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; dbus.el --- Elisp bindings for D-Bus. | 1 | ;;; dbus.el --- Elisp bindings for D-Bus. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2007, 2008 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Michael Albinus <michael.albinus@gmx.de> | 5 | ;; Author: Michael Albinus <michael.albinus@gmx.de> |
| 6 | ;; Keywords: comm, hardware | 6 | ;; Keywords: comm, hardware |
| @@ -247,9 +247,11 @@ usage: (dbus-name-owner-changed-handler service old-owner new-owner)" | |||
| 247 | (defun dbus-string-to-byte-array (string) | 247 | (defun dbus-string-to-byte-array (string) |
| 248 | "Transforms STRING to list (:array :byte c1 :byte c2 ...). | 248 | "Transforms STRING to list (:array :byte c1 :byte c2 ...). |
| 249 | STRING shall be UTF8 coded." | 249 | STRING shall be UTF8 coded." |
| 250 | (let (result) | 250 | (if (zerop (length string)) |
| 251 | (dolist (elt (string-to-list string) (append '(:array) result)) | 251 | '(:array :signature "y") |
| 252 | (setq result (append result (list :byte elt)))))) | 252 | (let (result) |
| 253 | (dolist (elt (string-to-list string) (append '(:array) result)) | ||
| 254 | (setq result (append result (list :byte elt))))))) | ||
| 253 | 255 | ||
| 254 | (defun dbus-byte-array-to-string (byte-array) | 256 | (defun dbus-byte-array-to-string (byte-array) |
| 255 | "Transforms BYTE-ARRAY into UTF8 coded string. | 257 | "Transforms BYTE-ARRAY into UTF8 coded string. |