Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
cc52b6cc
Commit
cc52b6cc
authored
Jun 17, 2013
by
Ted Zlatanov
Committed by
Katsumi Yamaoka
Jun 17, 2013
Browse files
lisp/gnus/auth-source.el: When a data token is "machine", abort parsing the current line
parent
9822de72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
lisp/gnus/ChangeLog
lisp/gnus/ChangeLog
+6
-0
lisp/gnus/auth-source.el
lisp/gnus/auth-source.el
+21
-2
No files found.
lisp/gnus/ChangeLog
View file @
cc52b6cc
2013-06-17 Teodor Zlatanov <tzz@lifelogs.com>
* auth-source.el (auth-source-current-line): New function.
(auth-source-netrc-parse-entries): When a data token is "machine",
assume we're in the wrong place and abort parsing the current line.
2013-06-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
* eww.el (eww-tag-select): Don't render totally empty <select> forms.
...
...
lisp/gnus/auth-source.el
View file @
cc52b6cc
...
...
@@ -1055,6 +1055,13 @@ Note that the MAX parameter is used so we can exit the parse early."
(
auth-source-netrc-parse-next-interesting
)
(
match-string-no-properties
1
)))
;; with thanks to org-mode
(
defsubst
auth-source-current-line
(
&optional
pos
)
(
save-excursion
(
and
pos
(
goto-char
pos
))
;; works also in narrowed buffer, because we start at 1, not point-min
(
+
(
if
(
bolp
)
1
0
)
(
count-lines
1
(
point
)))))
(
defun
auth-source-netrc-parse-entries
(
check
max
)
"Parse up to MAX netrc entries, passed by CHECK, from the current buffer."
(
let
((
adder
(
lambda
(
check
alist
all
)
...
...
@@ -1071,6 +1078,8 @@ Note that the MAX parameter is used so we can exit the parse early."
(
when
(
and
alist
(
or
default
(
equal
item
"machine"
)))
(
auth-source-do-trivia
"auth-source-netrc-parse-entries: got entry %S"
alist
)
(
setq
all
(
funcall
adder
check
alist
all
)
alist
nil
))
;; In default entries, we don't have a next token.
...
...
@@ -1079,11 +1088,21 @@ Note that the MAX parameter is used so we can exit the parse early."
(
push
(
cons
"machine"
t
)
alist
)
;; Not a default entry. Grab the next item.
(
when
(
setq
item2
(
auth-source-netrc-parse-one
))
(
push
(
cons
item
item2
)
alist
))))
;; Did we get a "machine" value?
(
if
(
equal
item2
"machine"
)
(
progn
(
gnus-error
1
"%s: Unexpected 'machine' token at line %d"
"auth-source-netrc-parse-entries"
(
auth-source-current-line
))
(
forward-line
1
))
(
push
(
cons
item
item2
)
alist
)))))
;; Clean up: if there's an entry left over, use it.
(
when
alist
(
setq
all
(
funcall
adder
check
alist
all
)))
(
setq
all
(
funcall
adder
check
alist
all
))
(
auth-source-do-trivia
"auth-source-netrc-parse-entries: got2 entry %S"
alist
))
(
nreverse
all
)))
(
defvar
auth-source-passphrase-alist
nil
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment