From 2088ebf8931efc19c93df290cb89a8f2e8982e81 Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Tue, 23 Mar 2021 20:31:44 +0100 Subject: [PATCH] Update cgi.c --- cgi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cgi.c b/cgi.c index 82a84d2..5a6142f 100644 --- a/cgi.c +++ b/cgi.c @@ -8,6 +8,7 @@ #include #include #include +#include #define MAX_ENV_SIZE 100 @@ -195,7 +196,7 @@ static void get_env_vars(antd_request_t *rq, envar_arr_t *env_vars) tmp = (char *)dvalue(request, "RESOURCE_PATH"); if (tmp) { - add_vars(env_vars, "SCRIPT_NAME", tmp); + add_vars(env_vars, "SCRIPT_NAME", basename(tmp)); tmp = __s("%s/%s", root, tmp); add_vars(env_vars, "SCRIPT_FILENAME", tmp); add_vars(env_vars, "PATH_TRANSLATED", tmp);