]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
Merge branch 'lh/range-search'
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index 38bc136596ce610cfe6cb08450658ecee5e590ca..ab25b6a00efe4889863b7625c22e9ea180d0fe61 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -258,6 +258,8 @@ static void querystring_cb(const char *name, const char *value)
                ctx.qry.ssdiff = atoi(value);
        } else if (!strcmp(name, "all")) {
                ctx.qry.show_all = atoi(value);
+       } else if (!strcmp(name, "context")) {
+               ctx.qry.context = atoi(value);
        }
 }
 
@@ -433,6 +435,12 @@ static void process_request(void *cbdata)
                return;
        }
 
+       /* If cmd->want_vpath is set, assume ctx->qry.path contains a "virtual"
+        * in-project path limit to be made available at ctx->qry.vpath.
+        * Otherwise, no path limit is in effect (ctx->qry.vpath = NULL).
+        */
+       ctx->qry.vpath = cmd->want_vpath ? ctx->qry.path : NULL;
+
        if (cmd->want_repo && !ctx->repo) {
                cgit_print_http_headers(ctx);
                cgit_print_docstart(ctx);