]> code.citadel.org Git - citadel.git/commitdiff
msgbase.c: fixed a bug in
authorArt Cancro <ajc@citadel.org>
Wed, 9 Aug 2000 17:14:34 +0000 (17:14 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 9 Aug 2000 17:14:34 +0000 (17:14 +0000)
           remove_any_whitespace_to_the_left_or_right_of_at_symbol() that was
           causing the <R>eply function to fail on names with whitespace in
           certain parts of the string.  This closes Bug #56.

citadel/ChangeLog
citadel/msgbase.c

index e40f735896546bcb61591f21594fc1db7aa81a2c..3c3afcd23467c56a95da148f9ac4f2a477f9fc6a 100644 (file)
@@ -1,4 +1,10 @@
  $Log$
+ Revision 572.23  2000/08/09 17:14:34  ajc
+ msgbase.c: fixed a bug in
+            remove_any_whitespace_to_the_left_or_right_of_at_symbol() that was
+            causing the <R>eply function to fail on names with whitespace in
+            certain parts of the string.  This closes Bug #56.
+
  Revision 572.22  2000/08/05 04:24:00  ajc
  * Added [idle] to client wholist display for sessions idle >15 minutes
  * Added a generic "void *userdata" field to CtdlForEachMessage()
@@ -1977,4 +1983,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index d5cae708470e5727971a7ede9f73c32dc73c3ff1..49df9330e0af8d73f12654ce3f51b650ad5781b4 100644 (file)
@@ -85,17 +85,18 @@ void remove_any_whitespace_to_the_left_or_right_of_at_symbol(char *name)
 {
        int i;
 
-       for (i = 0; i < strlen(name); ++i)
+stov:  for (i = 0; i < strlen(name); ++i) {
                if (name[i] == '@') {
                        if (i > 0)
                                if (isspace(name[i - 1])) {
                                        strcpy(&name[i - 1], &name[i]);
-                                       i = 0;
+                                       goto stov; /* start over */
                                }
                        while (isspace(name[i + 1])) {
                                strcpy(&name[i + 1], &name[i + 2]);
                        }
                }
+       }
 }
 
 
@@ -109,16 +110,13 @@ int alias(char *name)
        int a, b;
        char aaa[300], bbb[300];
 
-       TRACE;
        remove_any_whitespace_to_the_left_or_right_of_at_symbol(name);
-       TRACE;
 
        fp = fopen("network/mail.aliases", "r");
        if (fp == NULL)
                fp = fopen("/dev/null", "r");
        if (fp == NULL)
                return (MES_ERROR);
-       TRACE;
        strcpy(aaa, "");
        strcpy(bbb, "");
        while (fgets(aaa, sizeof aaa, fp) != NULL) {
@@ -135,7 +133,6 @@ int alias(char *name)
                if (!strcasecmp(name, aaa))
                        strcpy(name, bbb);
        }
-       TRACE;
        fclose(fp);
        lprintf(7, "Mail is being forwarded to %s\n", name);
 
@@ -150,18 +147,15 @@ int alias(char *name)
        }
 
        /* determine local or remote type, see citadel.h */
-       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '!')
                        return (MES_INTERNET);
-       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '@')
                        for (b = a; b < strlen(name); ++b)
                                if (name[b] == '.')
                                        return (MES_INTERNET);
        b = 0;
-       TRACE;
        for (a = 0; a < strlen(name); ++a)
                if (name[a] == '@')
                        ++b;
@@ -181,7 +175,6 @@ int alias(char *name)
 GETSN:         do {
                        a = getstring(fp, aaa);
                } while ((a >= 0) && (strcasecmp(aaa, bbb)));
-               TRACE;
                a = getstring(fp, aaa);
                if (!strncmp(aaa, "use ", 4)) {
                        strcpy(bbb, &aaa[4]);
@@ -189,7 +182,6 @@ GETSN:              do {
                        goto GETSN;
                }
                fclose(fp);
-               TRACE;
                if (!strncmp(aaa, "uum", 3)) {
                        strcpy(bbb, name);
                        for (a = 0; a < strlen(bbb); ++a) {
@@ -223,7 +215,6 @@ GETSN:              do {
                }
                return (MES_ERROR);
        }
-       TRACE;
        lprintf(9, "returning MES_LOCAL\n");
        return (MES_LOCAL);
 }