[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erc-commit] [commit][emacs22] Be careful with negated classes and newli
From: |
mwolson |
Subject: |
[Erc-commit] [commit][emacs22] Be careful with negated classes and newlines. |
Date: |
Sun, 14 Oct 2007 00:48:12 -0400 |
commit e7075eae5d500a6e60fc7e828edfed2cf8b63697
Author: Michael Olson <address@hidden>
Date: Sun Apr 2 18:37:06 2006 +0000
Be careful with negated classes and newlines.
* erc-backend.el, erc-ezbounce.el, erc-join.el, erc-netsplit.el, erc.el:
Make sure to include a newline inside of negated classes, so that a
newline is not matched.
git-archimport-id: address@hidden/erc--cvs--0--patch-152
diff --git a/ChangeLog b/ChangeLog
index 05a7266..f610603 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-02 Michael Olson <address@hidden>
+
+ * erc-backend.el, erc-ezbounce.el, erc-join.el, erc-netsplit.el,
+ erc.el: Make sure to include a newline inside of negated classes,
+ so that a newline is not matched.
+
2006-04-01 Michael Olson <address@hidden>
* erc-backend.el (erc-server-connect-function): Don't try to
diff --git a/erc-backend.el b/erc-backend.el
index 5d2903e..634e1cc 100644
--- a/erc-backend.el
+++ b/erc-backend.el
@@ -758,10 +758,10 @@ PROCs `process-buffer' is `current-buffer' when this
function is called."
(substring string 1 posn)))
(setf (erc-response.command msg)
- (let* ((bposn (string-match "[^ ]" string posn))
+ (let* ((bposn (string-match "[^ \n]" string posn))
(eposn (string-match " " string bposn)))
(setq posn (and eposn
- (string-match "[^ ]" string eposn)))
+ (string-match "[^ \n]" string eposn)))
(substring string bposn eposn)))
(while (and posn
@@ -769,7 +769,7 @@ PROCs `process-buffer' is `current-buffer' when this
function is called."
(push (let* ((bposn posn)
(eposn (string-match " " string bposn)))
(setq posn (and eposn
- (string-match "[^ ]" string eposn)))
+ (string-match "[^ \n]" string eposn)))
(substring string bposn eposn))
(erc-response.command-args msg)))
(when posn
diff --git a/erc-ezbounce.el b/erc-ezbounce.el
index e6f359b..518fc73 100644
--- a/erc-ezbounce.el
+++ b/erc-ezbounce.el
@@ -142,7 +142,7 @@ in the alist is `nil', prompt for the appropriate values."
(defun erc-ezb-add-session (message)
"Add an EZBounce session to the session list."
(when (and erc-ezb-inside-session-listing
- (string-match "^\\([^ ]+\\) +\\([^ ]+\\) +\\([^ ]+\\) +\\([^
]+\\)$" message))
+ (string-match "^\\([^ \n]+\\) +\\([^ \n]+\\) +\\([^ \n]+\\) +\\([^
\n]+\\)$" message))
(let ((id (match-string 1 message))
(nick (match-string 2 message))
(to (match-string 3 message)))
diff --git a/erc-join.el b/erc-join.el
index 8c861e4..02a7d4d 100644
--- a/erc-join.el
+++ b/erc-join.el
@@ -95,7 +95,7 @@ servers, presumably in the same domain."
(or erc-server-announced-name erc-session-server))))
(when (erc-current-nick-p nick)
(when (and erc-autojoin-domain-only
- (string-match "[^.]+\\.\\([^.]+\\.[^.]+\\)$" server))
+ (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
(setq server (match-string 1 server)))
(let ((elem (assoc server erc-autojoin-channels-alist)))
(if elem
@@ -118,7 +118,7 @@ servers, presumably in the same domain."
(or erc-server-announced-name erc-session-server))))
(when (erc-current-nick-p nick)
(when (and erc-autojoin-domain-only
- (string-match "[^.]+\\.\\([^.]+\\.[^.]+\\)$" server))
+ (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
(setq server (match-string 1 server)))
(let ((elem (assoc server erc-autojoin-channels-alist)))
(when elem
diff --git a/erc-netsplit.el b/erc-netsplit.el
index c372d61..5ef9d9e 100644
--- a/erc-netsplit.el
+++ b/erc-netsplit.el
@@ -67,7 +67,8 @@ sever buffer."
:group 'erc-netsplit
:type 'boolean)
-(defcustom erc-netsplit-regexp "^[^ @!\"]+\\.[^ @!]+ [^ @!]+\\.[^ @!\"]+$"
+(defcustom erc-netsplit-regexp
+ "^[^ @!\"\n]+\\.[^ @!\n]+ [^ @!\n]+\\.[^ @!\"\n]+$"
"This regular expression should match quit reasons produced
by netsplits."
:group 'erc-netsplit
@@ -134,7 +135,7 @@ join from that split has been detected or not.")
(defun erc-netsplit-MODE (proc parsed)
"Hide mode changes from servers."
;; regexp matches things with a . in them, and no ! or @ in them.
- (when (string-match "address@hidden@!]+$" (erc-response.sender parsed))
+ (when (string-match "address@hidden@!\n]+$" (erc-response.sender parsed))
(and erc-netsplit-debug
(erc-display-message
parsed 'notice (process-buffer proc)
diff --git a/erc.el b/erc.el
index 6ec06bf..f076d20 100644
--- a/erc.el
+++ b/erc.el
@@ -3503,7 +3503,7 @@ If FACE is non-nil, it will be used to propertize the
prompt. If it is nil,
If `point' is at the beginning of a channel name, use that as default."
(interactive
(list
- (let ((chnl (if (looking-at "\\([&#+!][^ ]+\\)") (match-string 1) ""))
+ (let ((chnl (if (looking-at "\\([&#+!][^ \n]+\\)") (match-string 1) ""))
(table (when (erc-server-buffer-live-p)
(set-buffer (process-buffer erc-server-process))
erc-channel-list)))
@@ -4747,12 +4747,12 @@ EmacsSpeak support."
Return a list of the three separate tokens."
(cond
- ((string-match "^\\([^!]*\\)!\\(address@hidden)@\\(.*\\)$" string)
+ ((string-match "^\\([^!\n]*\\)!\\(address@hidden)@\\(.*\\)$" string)
(list (match-string 1 string)
(match-string 2 string)
(match-string 3 string)))
;; Some bogus bouncers send Nick!(null), try to live with that.
- ((string-match "^\\([^!]*\\)!\\(.*\\)$" string)
+ ((string-match "^\\([^!\n]*\\)!\\(.*\\)$" string)
(list (match-string 1 string)
""
(match-string 2 string)))
@@ -5066,7 +5066,7 @@ user matches any regexp in `erc-ignore-reply-list'."
"Return the addressed target in MSG.
The addressed target is the string before the first colon in MSG."
- (if (string-match "^\\([^: ]*\\):" msg)
+ (if (string-match "^\\([^: \n]*\\):" msg)
(match-string 1 msg)
nil))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Erc-commit] [commit][emacs22] Be careful with negated classes and newlines.,
mwolson <=