summaryrefslogtreecommitdiff
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index b764b6d628..d289613b4b 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -223,6 +223,7 @@ void cgi_load_variables(void)
browser. Also doesn't allow for variables[] containing multiple variables
with the same name and the same or different values.
***************************************************************************/
+
const char *cgi_variable(const char *name)
{
int i;
@@ -234,6 +235,20 @@ const char *cgi_variable(const char *name)
}
/***************************************************************************
+ Version of the above that can't return a NULL pointer.
+***************************************************************************/
+
+const char *cgi_variable_nonull(const char *name)
+{
+ const char *var = cgi_variable(name);
+ if (var) {
+ return var;
+ } else {
+ return "";
+ }
+}
+
+/***************************************************************************
tell a browser about a fatal error in the http processing
***************************************************************************/
static void cgi_setup_error(const char *err, const char *header, const char *info)