* Got a primitive version of the wiki system in place. Needs a lot of fine
[citadel.git] / webcit / wiki.c
index 9d6a6b59b6da5979c89a50299f287bca4cdc7227..852650cb643a0b2dbca81ffce929aa8c9d7fe14f 100644 (file)
@@ -50,18 +50,22 @@ void display_wiki_page(void)
        safestrncpy(pagename, bstr("page"), sizeof pagename);
        str_wiki_index(pagename);
 
-       /* If we're not in the correct room, try going there. */
-       if (strcasecmp(roomname, WC->wc_roomname)) {
-               gotoroom(roomname);
-       }
+       if (strlen(roomname) > 0) {
+
+               /* If we're not in the correct room, try going there. */
+               if (strcasecmp(roomname, WC->wc_roomname)) {
+                       gotoroom(roomname);
+               }
+       
+               /* If we're still not in the correct room, it doesn't exist. */
+               if (strcasecmp(roomname, WC->wc_roomname)) {
+                       snprintf(errmsg, sizeof errmsg,
+                               _("There is no room called '%s'."),
+                               roomname);
+                       convenience_page("FF0000", _("Error"), errmsg);
+                       return;
+               }
 
-       /* If we're still not in the correct room, it doesn't exist. */
-       if (strcasecmp(roomname, WC->wc_roomname)) {
-               snprintf(errmsg, sizeof errmsg,
-                       _("There is no room called '%s'."),
-                       roomname);
-               convenience_page("FF0000", _("Error"), errmsg);
-               return;
        }
 
        if (WC->wc_view != VIEW_WIKI) {