aboutsummaryrefslogtreecommitdiffstats
path: root/uid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1999-08-01 06:47:46 +0000
committerEric S. Raymond <esr@thyrsus.com>1999-08-01 06:47:46 +0000
commit31a766b10679534993eada1bdeb9a6f7cb5585c0 (patch)
treedd1dc17b0f54bc566779db30408caa97c2d9bec5 /uid.c
parentbb524b27a4d0e3e1ba42f2a66326faa5ac671f65 (diff)
downloadfetchmail-31a766b10679534993eada1bdeb9a6f7cb5585c0.tar.gz
fetchmail-31a766b10679534993eada1bdeb9a6f7cb5585c0.tar.bz2
fetchmail-31a766b10679534993eada1bdeb9a6f7cb5585c0.zip
Split in rightmost @
svn path=/trunk/; revision=2529
Diffstat (limited to 'uid.c')
-rw-r--r--uid.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/uid.c b/uid.c
index 09ea5684..8c5040f2 100644
--- a/uid.c
+++ b/uid.c
@@ -84,8 +84,17 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
while (fgets(buf, POPBUFSIZE, tmpfp) != (char *)NULL)
{
- /* possible lossage here with very old versions of sscanf(3)... */
- if ((st = sscanf(buf, "%[^@]@%s %s\n", user, host, id)) == 3)
+ /*
+ * This inelegant hack was brought to you by the fact that
+ * some dial-up resellers actually use account names with
+ * @ in them. So we need to split on the rightmost @...
+ */
+ char *atsign = strrchr(buf, '@');
+
+ if (atsign)
+ *atsign = ' ';
+
+ if ((st = sscanf(buf, "%s %s %s\n", user, host, id)) == 3)
{
for (ctl = hostlist; ctl; ctl = ctl->next)
{