Function: tramp-gvfs-dbus-byte-array-to-string

tramp-gvfs-dbus-byte-array-to-string is a byte-compiled function defined in tramp-gvfs.el.gz.

Signature

(tramp-gvfs-dbus-byte-array-to-string BYTE-ARRAY)

Documentation

Like dbus-byte-array-to-string but remove trailing \0 if exists.

Return nil for null BYTE-ARRAY.

Source Code

;; Defined in /usr/src/emacs/lisp/net/tramp-gvfs.el.gz
(defun tramp-gvfs-dbus-byte-array-to-string (byte-array)
  "Like `dbus-byte-array-to-string' but remove trailing \\0 if exists.
Return nil for null BYTE-ARRAY."
  ;; The byte array could be a variant.  Take care.
  (when-let ((byte-array
	      (if (and (consp byte-array) (atom (car byte-array)))
		  byte-array (car byte-array))))
    (dbus-byte-array-to-string
     (if (and (consp byte-array) (zerop (car (last byte-array))))
	 (butlast byte-array) byte-array))))