emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/base32 da1498e54d 102/103: Handle empty user strings bette


From: ELPA Syncer
Subject: [nongnu] elpa/base32 da1498e54d 102/103: Handle empty user strings better when creating labels for secrets
Date: Sat, 10 Feb 2024 13:00:14 -0500 (EST)

branch: elpa/base32
commit da1498e54df8802efe2174c0e988c23fea49fc79
Author: Vivek Das Mohapatra <vivek@collabora.com>
Commit: Vivek Das Mohapatra <vivek@collabora.com>

    Handle empty user strings better when creating labels for secrets
---
 totp-auth.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/totp-auth.el b/totp-auth.el
index a8933d51ee..6a5088899d 100644
--- a/totp-auth.el
+++ b/totp-auth.el
@@ -415,9 +415,9 @@ The label will be based on its user and service fields."
     (setq user     (cdr (assq :user secret))
           srv-host (cdr (or (assq :service secret)
                             (assq :host    secret))))
-    (if (and user srv-host)
+    (if (and user (> (length user) 0) srv-host)
         (concat user "@" srv-host)
-      (or user srv-host "nobody@unknown"))))
+      (or srv-host user "nobody@unknown"))))
 
 (defun totp-auth-secret-make-label-and-wrapper (secret &optional label)
   "Take a ‘totp-auth-unwrap-otp-blob’ SECRET and make a LABEL and otpauth URL.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]