]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove two string-as-unibyte in gnus-srvr.el
authorLars Ingebrigtsen <larsi@gnus.org>
Sat, 14 Apr 2018 21:54:07 +0000 (23:54 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 14 Apr 2018 21:54:07 +0000 (23:54 +0200)
* lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): We do not
seem to need the string-as-unibyte here: We read a multibyte
string from the *nntpd* buffer and then decode it later, and this
apparently by some strange magic leads to the correct results in
my test cases.

lisp/gnus/gnus-srvr.el

index 94fd21b9204e3c67af39a8b9f3dc8c7b76f86f50..dfca5e9d2cbce7638b6d62df54c4a44fb62c31a9 100644 (file)
@@ -808,12 +808,11 @@ claim them."
              (while (not (eobp))
                (ignore-errors
                  (push (cons
-                        (string-as-unibyte
-                         (buffer-substring
-                          (point)
-                          (progn
-                            (skip-chars-forward "^ \t")
-                            (point))))
+                        (buffer-substring
+                         (point)
+                         (progn
+                           (skip-chars-forward "^ \t")
+                           (point)))
                         (let ((last (read cur)))
                           (cons (read cur) last)))
                        groups))
@@ -821,19 +820,18 @@ claim them."
            (while (not (eobp))
              (ignore-errors
                (push (cons
-                      (string-as-unibyte
-                       (if (eq (char-after) ?\")
-                           (read cur)
-                         (let ((p (point)) (name ""))
-                           (skip-chars-forward "^ \t\\\\")
-                           (setq name (buffer-substring p (point)))
-                           (while (eq (char-after) ?\\)
-                             (setq p (1+ (point)))
-                             (forward-char 2)
-                             (skip-chars-forward "^ \t\\\\")
-                             (setq name (concat name (buffer-substring
-                                                      p (point)))))
-                           name)))
+                      (if (eq (char-after) ?\")
+                          (read cur)
+                        (let ((p (point)) (name ""))
+                          (skip-chars-forward "^ \t\\\\")
+                          (setq name (buffer-substring p (point)))
+                          (while (eq (char-after) ?\\)
+                            (setq p (1+ (point)))
+                            (forward-char 2)
+                            (skip-chars-forward "^ \t\\\\")
+                            (setq name (concat name (buffer-substring
+                                                     p (point)))))
+                          name))
                       (let ((last (read cur)))
                         (cons (read cur) last)))
                      groups))