summaryrefslogtreecommitdiff
path: root/lisp/erc
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc')
-rw-r--r--lisp/erc/ChangeLog8
-rw-r--r--lisp/erc/ChangeLog.0212
-rw-r--r--lisp/erc/erc-dcc.el21
-rw-r--r--lisp/erc/erc.el2
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))