{
register int stat;
char ** args;
+ struct qelem *elem = NULL;
if ((args = AskListInfo(info, TRUE)) == NULL) {
Put_message("Aborted.");
return;
}
+
+ /*
+ * If the new list name is less than 8 characters, make sure it doesn't
+ * collide with a username.
+ */
+ if ((strlen(args[2]) <= 8) &&
+ do_mr_query("get_user_account_by_login", 1, args + 1,
+ StoreInfo, (char *) &elem) != MR_NO_MATCH) {
+ char buf[256];
+
+ sprintf(buf, "\nA user by the name `%s' already exists in the database.",
+ args[1]);
+ Put_message(buf);
+ Loop(QueueTop(elem), FreeInfo);
+ FreeQueue(elem);
+ if (YesNoQuestion("Do you still want to rename this list to that name",
+ FALSE) != TRUE) {
+ Put_message("List ** NOT ** Updated.");
+ return;
+ }
+ }
+
if ( (stat = do_mr_query("update_list", CountArgs(args), args,
Scream, (char *) NULL)) != MR_SUCCESS) {
com_err(program_name, stat, " in UpdateList.");
*/
if ((strlen(argv[1]) <= 8) &&
do_mr_query("get_user_account_by_login", 1, argv + 1,
- StoreInfo, (char *) &elem) == 0) {
- Put_message("A user by that name already exists in the database.");
+ StoreInfo, (char *) &elem) != MR_NO_MATCH) {
+ char buf[256];
+
+ sprintf(buf, "\nA user by the name `%s' already exists in the database.",
+ argv[1]);
+ Put_message(buf);
Loop(QueueTop(elem), FreeInfo);
FreeQueue(elem);
if (YesNoQuestion("Crate a list with the same name",