summaryrefslogtreecommitdiff
path: root/lisp/erc/erc-dcc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-dcc.el')
-rw-r--r--lisp/erc/erc-dcc.el48
1 files changed, 24 insertions, 24 deletions
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index eeb3e93801e..2c906af4516 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -1,6 +1,6 @@
;;; erc-dcc.el --- CTCP DCC module for ERC
-;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006
+;; Copyright (C) 1993, 1994, 1995, 1998, 2002, 2003, 2004, 2006, 2007
;; Free Software Foundation, Inc.
;; Author: Ben A. Mesander <ben@gnu.ai.mit.edu>
@@ -863,29 +863,29 @@ buffer, and sends back the replies after each block of data per the DCC
protocol spec. Well not really. We write back a reply after each read,
rather than every 1024 byte block, but nobody seems to care."
(with-current-buffer (process-buffer proc)
- (setq buffer-read-only nil) ;; FIXME
- (goto-char (point-max))
- (insert (string-make-unibyte str))
-
- (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
- (erc-assert (= erc-dcc-byte-count (1- (point-max))))
- (and erc-verbose-dcc
- (erc-display-message
- nil 'notice erc-server-process
- 'dcc-get-bytes-received
- ?f (file-name-nondirectory buffer-file-name)
- ?b (number-to-string erc-dcc-byte-count)))
- (cond
- ((and (> (plist-get erc-dcc-entry-data :size) 0)
- (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size)))
- (erc-display-message
- nil '(error notice) 'active
- 'dcc-get-file-too-long
- ?f (file-name-nondirectory buffer-file-name))
- (delete-process proc))
- (t
- (process-send-string
- proc (erc-pack-int erc-dcc-byte-count 4))))))
+ (let ((inhibit-read-only t))
+ (goto-char (point-max))
+ (insert (string-make-unibyte str))
+
+ (setq erc-dcc-byte-count (+ (length str) erc-dcc-byte-count))
+ (erc-assert (= erc-dcc-byte-count (1- (point-max))))
+ (and erc-verbose-dcc
+ (erc-display-message
+ nil 'notice erc-server-process
+ 'dcc-get-bytes-received
+ ?f (file-name-nondirectory buffer-file-name)
+ ?b (number-to-string erc-dcc-byte-count)))
+ (cond
+ ((and (> (plist-get erc-dcc-entry-data :size) 0)
+ (> erc-dcc-byte-count (plist-get erc-dcc-entry-data :size)))
+ (erc-display-message
+ nil '(error notice) 'active
+ 'dcc-get-file-too-long
+ ?f (file-name-nondirectory buffer-file-name))
+ (delete-process proc))
+ (t
+ (process-send-string
+ proc (erc-pack-int erc-dcc-byte-count 4)))))))
(defun erc-dcc-get-sentinel (proc event)