implicit 'action=object' when 'object=' is given and no action set
authorChristian Thaeter <ct@pipapo.org>
Sat, 29 Dec 2007 11:38:27 +0000 (12:38 +0100)
committerChristian Thaeter <ct@pipapo.org>
Sat, 29 Dec 2007 11:38:27 +0000 (12:38 +0100)
src/object.c
src/query.c

index c3579aa3dc00f59aa019092c47ff164c0881eca7..01767ca67bf6e886ae58d3396c66b916c8a055af 100644 (file)
@@ -26,7 +26,7 @@ ctgit_object_link (struct ctgit_query* query, struct ctgit_repo_info* n, const c
 {
   return html (
                html_tag ("a",
 {
   return html (
                html_tag ("a",
-                         html_attr ("href", html_fmt ("%s?repo=%s&action=object&object=%s",
+                         html_attr ("href", html_fmt ("%s?repo=%s&object=%s",
                                                       query->request->script_name,
                                                       n->name,
                                                       object)
                                                       query->request->script_name,
                                                       n->name,
                                                       object)
index 0c44134f3c77f0be284004e51de29a6775e3a3e5..fc11c4e3ea724e3b6d6036d9d2cf6cba75abba94 100644 (file)
@@ -104,6 +104,12 @@ ctgit_object_param (const Cgi self, const char* v, size_t v_sz, void* u_dat)
 {
   struct ctgit_query* q = (struct ctgit_query*) u_dat;
 
 {
   struct ctgit_query* q = (struct ctgit_query*) u_dat;
 
+  if (*q->action == '\0')
+    {
+      free (q->action);
+      q->action = cwa_strndup ("object", SIZE_MAX);
+    }
+
   free (q->object);
   q->object = cwa_strndup (v, SIZE_MAX);
 
   free (q->object);
   q->object = cwa_strndup (v, SIZE_MAX);