]> andersk Git - moira.git/blobdiff - server/qsupport.pc
Move UNIX->SQL wildcard conversion from the validation stage to the
[moira.git] / server / qsupport.pc
index d6881099875346bfeae1507b97a1c2fdb228271b..dbae9311a4d8701dfa68477e0a91316cf7bd8506 100644 (file)
@@ -110,7 +110,7 @@ int get_list_info(q, aargv, cl, action, actarg)
      client *cl;
      int (*action)(), actarg;
 {
-    char *argv[13];
+    char *argv[13], *s, *d;
     EXEC SQL BEGIN DECLARE SECTION;
     char *name, acl_type[9], listname[33], active[5], public[5], hidden[5];
     char maillist[5], grouplist[5], gid_str[6], desc[256];
@@ -121,12 +121,23 @@ int get_list_info(q, aargv, cl, action, actarg)
     struct save_queue *sq, *sq_create();
 
     returned = rowcount = 0;
-    name = aargv[0];
-    convert_wildcards(name);
+
+    /* copy list name and fix wildcards */
+    name = malloc(2 * strlen(aargv[0]) + 1);
+    for (s = aargv[0], d = name; *s; s++, d++)
+       switch (*s) {
+           case '*': *d = '%'; break;
+           case '?': *d = '_'; break;
+           case '%':
+           case '_': *d++ = '*'; /* fall through */
+           default:  *d = *s; break;
+       }
+    *d = '\0';
 
     sq = sq_create();
     EXEC SQL DECLARE csr102 CURSOR FOR SELECT list_id FROM list
       WHERE name LIKE :name ESCAPE '*';
+    free(name);
     if (dbms_errno)
        return(mr_errcode);
     EXEC SQL OPEN csr102;
This page took 1.963863 seconds and 4 git commands to generate.