projects
/
org.ibex.mail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3da176
)
better support for spaces in email addresses
author
adam
<adam@megacz.com>
Fri, 7 Jan 2005 18:24:30 +0000
(18:24 +0000)
committer
adam
<adam@megacz.com>
Fri, 7 Jan 2005 18:24:30 +0000
(18:24 +0000)
darcs-hash:
20050107182430
-5007d-
57e6283826f4f3e9f3085d0de31c935a156d2171
.gz
src/org/ibex/mail/Address.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/mail/Address.java
b/src/org/ibex/mail/Address.java
index
71bbd61
..
694523d
100644
(file)
--- a/
src/org/ibex/mail/Address.java
+++ b/
src/org/ibex/mail/Address.java
@@
-20,8
+20,14
@@
public class Address extends JSReflection implements Serializable {
public Address(String user, String host, String description) {this.user=user;this.host=host;this.description=description;}
public Address(String s0) throws Address.Malformed {
String s = s0.trim();
public Address(String user, String host, String description) {this.user=user;this.host=host;this.description=description;}
public Address(String s0) throws Address.Malformed {
String s = s0.trim();
- if (s.indexOf('<') == -1) description = "";
- else {
+ if (s.indexOf('<') == -1) {
+ if (s.indexOf(' ') == -1) {
+ description = "";
+ } else {
+ description = s.substring(s.indexOf(' ')).trim();
+ s = s.substring(0, s.indexOf(' '));
+ }
+ } else {
if (s.indexOf('>') == -1) { throw new Malformed("found open-angle-bracket (<) but not close-angle-bracket (>)"); }
description = s.substring(0, s.indexOf('<')) + s.substring(s.indexOf('>') + 1);
s = s.substring(s.indexOf('<') + 1, s.indexOf('>'));
if (s.indexOf('>') == -1) { throw new Malformed("found open-angle-bracket (<) but not close-angle-bracket (>)"); }
description = s.substring(0, s.indexOf('<')) + s.substring(s.indexOf('>') + 1);
s = s.substring(s.indexOf('<') + 1, s.indexOf('>'));