diff options
author | Joakim Verona <joakim@verona.se> | 2011-12-28 04:12:56 +0100 |
---|---|---|
committer | Joakim Verona <joakim@verona.se> | 2011-12-28 04:12:56 +0100 |
commit | bb29f044aa967831cd664c54eba0de0c701436ce (patch) | |
tree | 1398cc9780bbae0fdad071a3a3765a571c3f6d7b /lisp/erc | |
parent | 3c935a7e996701244d166f684119f0ff97e25496 (diff) | |
parent | 5e605a2e528955721fc6f2bd7b9f174c15075fb1 (diff) | |
download | emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.gz emacs-bb29f044aa967831cd664c54eba0de0c701436ce.tar.bz2 emacs-bb29f044aa967831cd664c54eba0de0c701436ce.zip |
upstream i think
Diffstat (limited to 'lisp/erc')
-rw-r--r-- | lisp/erc/ChangeLog | 8 | ||||
-rw-r--r-- | lisp/erc/ChangeLog.02 | 12 | ||||
-rw-r--r-- | lisp/erc/erc-dcc.el | 21 | ||||
-rw-r--r-- | lisp/erc/erc.el | 2 |
4 files changed, 31 insertions, 12 deletions
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 3fd2c87d59c..1b67835cb07 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,11 @@ +2011-11-28 Mike Kazantsev <mk.fraggod@gmail.com> (tiny change) + + * erc-dcc.el (erc-dcc-ctcp-query-send-regexp): Updated regexp to + match quoted filenames with spaces inside. + (erc-dcc-handle-ctcp-send): Updated regexp match group numbers, + added processing of escaped quotes and backslashes if filename + itself was in quotes. + 2011-11-20 Juanma Barranquero <lekktu@gmail.com> * erc-log.el (erc-logging-enabled): Fix typo. diff --git a/lisp/erc/ChangeLog.02 b/lisp/erc/ChangeLog.02 index 279a336f15f..3364af531f5 100644 --- a/lisp/erc/ChangeLog.02 +++ b/lisp/erc/ChangeLog.02 @@ -979,7 +979,7 @@ 2002-11-16 Alex Schroeder <alex@gnu.org> - * erc-autoaway.el, erc-button.el, erc-fill.el, erc-match.el, + * erc-autoaway.el, erc-button.el, erc-fill.el, erc-match.el, erc-menu.el, erc-ring.el, erc-track.el: Cleanup of file headers: copyright years, GPL mumbo-jumbo, commentaries. @@ -1447,7 +1447,7 @@ * erc-match.el: fixed spelling error * erc-track.el, erc-match.el: * erc-match.el: - highlight current nickname in its own face (deactivated by default): + highlight current nickname in its own face (inactive by default): - added erc-current-nick-highlight-type, erc-current-nick-face, erc-current-nick-p @@ -1564,7 +1564,7 @@ (require 'erc-nickserv) is now necessary for this to work * erc.el: - * results of /COUNTRY now formatted as notice; errors are ignored, + * results of /COUNTRY now formatted as notice; errors are ignored, fixing bug which made prompt disappear @@ -1959,9 +1959,9 @@ * erc.el: remove trailing \n from any sent text - * servers.pl, erc-bbdb.el, erc-button.el, erc-chess.el, - erc-complete.el, erc-fill.el, erc-ibuffer.el, erc-list.el, - erc-match.el, erc-menu.el, erc-nets.el, erc-replace.el, + * servers.pl, erc-bbdb.el, erc-button.el, erc-chess.el, + erc-complete.el, erc-fill.el, erc-ibuffer.el, erc-list.el, + erc-match.el, erc-menu.el, erc-nets.el, erc-replace.el, erc-speak.el, erc-speedbar.el, erc-track.el, erc.el: clean whitespace diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el index 19e1801e03c..fce22aadcc4 100644 --- a/lisp/erc/erc-dcc.el +++ b/lisp/erc/erc-dcc.el @@ -649,7 +649,16 @@ that subcommand." ?q query ?n nick ?u login ?h host)))) (defconst erc-dcc-ctcp-query-send-regexp - "^DCC SEND \\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)") + (concat "^DCC SEND \\(" + ;; Following part matches either filename without spaces + ;; or filename enclosed in double quotes with any number + ;; of escaped double quotes inside. + "\"\\(\\(.*?\\(\\\\\"\\)?\\)+?\\)\"\\|\\([^ ]+\\)" + "\\) \\([0-9]+\\) \\([0-9]+\\) *\\([0-9]*\\)")) + +(defsubst erc-dcc-unquote-filename (filename) + (erc-replace-regexp-in-string "\\\\\\\\" "\\" + (erc-replace-regexp-in-string "\\\\\"" "\"" filename t t) t t)) (defun erc-dcc-handle-ctcp-send (proc query nick login host to) "This is called if a CTCP DCC SEND subcommand is sent to the client. @@ -664,10 +673,12 @@ It extracts the information about the dcc request and adds it to 'dcc-request-bogus ?r "SEND" ?n nick ?u login ?h host)) ((string-match erc-dcc-ctcp-query-send-regexp query) - (let ((filename (match-string 1 query)) - (ip (erc-decimal-to-ip (match-string 2 query))) - (port (match-string 3 query)) - (size (match-string 4 query))) + (let ((filename + (or (match-string 3 query) + (erc-dcc-unquote-filename (match-string 2 query)))) + (ip (erc-decimal-to-ip (match-string 6 query))) + (port (match-string 7 query)) + (size (match-string 8 query))) ;; FIXME: a warning really should also be sent ;; if the ip address != the host the dcc sender is on. (erc-display-message diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index a218dd12555..0eff33f1e75 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2626,7 +2626,7 @@ VALUE is computed by evaluating the rest of LINE in Lisp." (defun erc-cmd-default (line) "Fallback command. -Commands for which no erc-cmd-xxx exists, are tunnelled through +Commands for which no erc-cmd-xxx exists, are tunneled through this function. LINE is sent to the server verbatim, and therefore has to contain the command itself as well." (erc-log (format "cmd: DEFAULT: %s" line)) |