X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/067c1804353ad9ebca702a636d8d42a288459550..6180e6169d6e87a3bea7e4da835dca17f93e5cfd:/cgit.c diff --git a/cgit.c b/cgit.c index 9305d0a..e9bafb5 100644 --- a/cgit.c +++ b/cgit.c @@ -250,6 +250,8 @@ static void querystring_cb(const char *name, const char *value) ctx.qry.period = xstrdup(value); } else if (!strcmp(name, "ss")) { ctx.qry.ssdiff = atoi(value); + } else if (!strcmp(name, "context")) { + ctx.qry.context = atoi(value); } } @@ -424,6 +426,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);