Re: Realnames with dot.

Robert <[email protected]>
Newsgroups gmane.network.slrn.user
Organization Disorganized
Message-ID <[email protected]>
John E. Davis <[email protected]> wrote:
> Once I start working on slrn again, I intend to scrap those functions
> in favor of the ones in parse2882.c.  I cannot say when I will do this
> because slrn appears to be working quite well.  Feel free to send me a
> patch, which I will integrate on a much shorter time scale.  Thanks, --John

Maybe this will do. Still have to do some testing. I will get back to
it.
#v+
diff -urNad slrn-1.0.0~pre11~/src/art.c slrn-1.0.0~pre11/src/art.c
--- slrn-1.0.0~pre11~/src/art.c	2009-09-18 11:35:18.000000000 +0200
+++ slrn-1.0.0~pre11/src/art.c	2009-09-18 11:39:47.184687883 +0200
@@ -1923,6 +1923,35 @@
 }
 /*}}}*/
 
+/* Copy a obs-phrase from start to dest (which can hold at least max chars).
+ * Returns: Length of the obs-phrase; if it is > max, it has not been fully
+ * copied to dest
+ */
+static size_t read_obsphrase (char *start, char *dest, size_t max) /*{{{*/
+{
+   size_t len = 0;
+
+   if (len < max)
+      *dest++ = *start;
+   len++;
+   start++;
+
+   while (1)
+     {
+        if ((*start == '\0') ||
+            (NULL != slrn_strbyte ("\t \"(),:;<>@[\\]", *start)))
+           break;
+	
+	if (len < max)
+             *dest++ = *start;
+        
+	len += 1;
+        start++;
+     }
+   return len;
+}
+/*}}}*/
+
 /* Copy the localpart of an email address from start to dest.
  * The result will be NUL-terminated.
  * Returns a pointer to the char behind the localpart (or NULL, if nothing
@@ -1950,7 +1979,7 @@
      }
    else if (*start && (NULL == slrn_strbyte ("\t \"(),.:;<>@[\\]", *start)))
      {
-	len = read_dotatom (start, dest, max ? max-1 : 0);
+	len = read_obsphrase (start, dest, max ? max-1 : 0);
      }
    else
      {
#v-
Rob
-- 
"Violence is the resort of the violent" Lu Tze
               "Thief of Time", Terry Pratchett   


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.