[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to gnats/gnats/mail.c
From: |
Milan Zamazal |
Subject: |
Changes to gnats/gnats/mail.c |
Date: |
Sun, 01 Sep 2002 08:14:48 -0400 |
Index: gnats/gnats/mail.c
diff -c gnats/gnats/mail.c:1.16 gnats/gnats/mail.c:1.17
*** gnats/gnats/mail.c:1.16 Wed Oct 17 13:04:53 2001
--- gnats/gnats/mail.c Sun Sep 1 08:14:47 2002
***************
*** 1,5 ****
/* Mail processing routines for GNATS.
! Copyright (C) 2000 Free Software Foundation, Inc.
Contributed by Bob Manson (address@hidden).
This file is part of GNU GNATS.
--- 1,5 ----
/* Mail processing routines for GNATS.
! Copyright (C) 2000, 2002 Free Software Foundation, Inc.
Contributed by Bob Manson (address@hidden).
This file is part of GNU GNATS.
***************
*** 179,187 ****
getOneAddress (const char **addrPtr)
{
const char *addr = *addrPtr;
! const char *addrStart = addr;
char *res;
while (*addr != ',' && *addr != '\0')
{
char nextc = '\0';
--- 179,199 ----
getOneAddress (const char **addrPtr)
{
const char *addr = *addrPtr;
! const char *addrStart, *addrEnd;
char *res;
+ if (addrPtr == NULL || *addrPtr == NULL)
+ {
+ return NULL;
+ }
+
+ /* skip over leading white space */
+ while (*addr && isspace(*addr))
+ {
+ addr++;
+ }
+ addrStart = addr;
+
while (*addr != ',' && *addr != '\0')
{
char nextc = '\0';
***************
*** 211,227 ****
}
addr++;
}
! res = xstrndup (addrStart, addr - addrStart);
! if (*addr != '\0')
{
! addr++;
! }
! else
! {
! addr = NULL;
}
! *addrPtr = addr;
return res;
}
--- 223,239 ----
}
addr++;
}
! addrEnd = addr;
! /* ignore any ending white space */
! while (addr >= addrStart && isspace(*(addr-sizeof(*addr))))
{
! addr--;
}
!
! res = xstrndup (addrStart, addr - addrStart);
!
! *addrPtr = (*addrEnd == '\0') ? NULL : addrEnd+1;
return res;
}
***************
*** 234,247 ****
while (c != NULL)
{
char *addr = getOneAddress (&c);
! char *respaddr = get_one_responsible_addr (database, full, strict,
addr);
if (respaddr != NULL)
{
if (res != NULL)
{
! append_string (&res, ", ");
}
append_string (&res, respaddr);
free (respaddr);
--- 246,264 ----
while (c != NULL)
{
+ char *respaddr;
char *addr = getOneAddress (&c);
! if (addr == NULL || *addr == NULL)
! {
! break;
! }
! respaddr = get_one_responsible_addr (database, full, strict, addr);
if (respaddr != NULL)
{
if (res != NULL)
{
! append_string (&res, ",");
}
append_string (&res, respaddr);
free (respaddr);
- Changes to gnats/gnats/mail.c,
Milan Zamazal <=