aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ename/e-address-western.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/e-util/ename/e-address-western.c b/e-util/ename/e-address-western.c
index d4dcda995e..b6ced3bebf 100644
--- a/e-util/ename/e-address-western.c
+++ b/e-util/ename/e-address-western.c
@@ -13,8 +13,15 @@
#include <string.h>
#include <glib.h>
+#ifdef E_ADDRESS_WESTERN_TEST
+
+#include "e-address-western.h"
+
+#else
+
#include <ename/e-address-western.h>
+#endif
static gboolean
e_address_western_is_line_blank (gchar *line)
@@ -195,6 +202,10 @@ e_address_western_extract_locality (gchar *line)
return g_strndup (line, index);
}
+
+/* Whatever resides between the comma and the start of the
+ postal code is deemed to be the region. */
+
gchar *
e_address_western_extract_region (gchar *line)
{
@@ -205,10 +216,17 @@ e_address_western_extract_region (gchar *line)
while (isspace(line[start]))
start++;
- end = start;
+ end = strlen(line) - 1;
+ while (isspace (line[end]))
+ end--;
+
while (!isspace (line[end]))
- end++;
-
+ end--;
+
+ while (isspace (line[end]))
+ end--;
+ end++;
+
/* Between start and end lie the string. */
return g_strndup ( (line+start), end-start);
}
'>* [maintainer] change maintainer mail addressedwin2006-01-111-1/+1 * [maintainer update] 16 ports: add mirror MASTER_SITESedwin2005-01-131-1/+2 * [maintainer update] net/tcping: update MASTER_SITES and WWWedwin2004-12-152-2/+2 * Update to 1.3.4clive2004-11-112-15/+5 * - Update checksum in distinfo. I verified there's no actual changes. Unbreak.pav2004-02-232-4/+15 * BROKEN: Checksum mismatchkris2004-02-221-0/+2