summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ac01708)
raw | patch | inline | side by side (parent: ac01708)
author | Florian Forster <ff@octo.it> | |
Fri, 18 Jun 2010 18:23:54 +0000 (20:23 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Fri, 18 Jun 2010 18:23:54 +0000 (20:23 +0200) |
src/action_list_graphs.c | patch | blob | history | |
src/utils_params.c | patch | blob | history | |
src/utils_params.h | patch | blob | history |
index 29e3d8b887839b3c3424578280e38e68e89c691a..395d8a14ade0066ccea7ee691d5e4aa0ac64a3e0 100644 (file)
--- a/src/action_list_graphs.c
+++ b/src/action_list_graphs.c
memset (desc, 0, sizeof (desc));
inst_describe (cfg, inst, desc, sizeof (desc));
- printf (" <li><a href=\"test.fcgi?action=graph;%s\">%s</a></li>\n",
- params, desc);
+ printf (" <li><a href=\"%s?action=graph;%s\">%s</a></li>\n",
+ script_name (), params, desc);
return (0);
} /* }}} int print_graph_inst_html */
diff --git a/src/utils_params.c b/src/utils_params.c
index 6e5dc892e377a43fb8b619772767dd1d13e02854..2c7bcc2e6fc409a007c04162162ed0fef587a0b5 100644 (file)
--- a/src/utils_params.c
+++ b/src/utils_params.c
} /* while (42) */
} /* }}} int uri_escape */
+const char *script_name (void)
+{
+ char *ret;
+
+ ret = getenv ("SCRIPT_NAME");
+ if (ret == NULL)
+ ret = "collection4.fcgi";
+
+ return (ret);
+} /* }}} char *script_name */
+
/* vim: set sw=2 sts=2 et fdm=marker : */
diff --git a/src/utils_params.h b/src/utils_params.h
index 3c7ea0a2091df2211659ed721f9ead6038af590f..5d0c845fe135fd3b39b09e70a88897a114a9d6af 100644 (file)
--- a/src/utils_params.h
+++ b/src/utils_params.h
int uri_escape (char *dst, const char *src, size_t size);
+const char *script_name (void);
+
#endif /* UTILS_PARAMS_H */