commit - 72657dc95c57d4424da879f2d70ea0510077562f
commit + e2ac8a3da0010ac9a2d6ed0457d75d71b3a27ce5
blob - bedeb4baba587c7ff5074b8f25ccf65f1ce1e9b6
blob + a3af7ecdcc4dfcc32a7dee15fc4c302b1a627efd
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
{ "headref", HEADREF },
{ "index_page", INDEX_PAGE },
{ "path", PATH },
- { "page", PAGE },
};
static const struct action_keys action_keys[] = {
if (binary) {
struct gotweb_url url = {
.index_page = -1,
- .page = -1,
.action = BLOBRAW,
.path = qs->path,
.commit = qs->commit,
goto done;
}
break;
- case PAGE:
- if (*value == '\0')
- break;
- (*qs)->page = strtonum(value, INT64_MIN,
- INT64_MAX, &errstr);
- if (errstr) {
- error = got_error_from_errno3(__func__,
- "strtonum", errstr);
- goto done;
- }
- if ((*qs)->page < 0)
- (*qs)->page = 0;
- break;
}
/* entry found */
*prev = (struct gotweb_url){
.action = -1,
.index_page = qs->index_page - 1,
- .page = -1,
};
}
if (t->next_disp == srv->max_repos_display &&
*next = (struct gotweb_url){
.action = -1,
.index_page = qs->index_page + 1,
- .page = -1,
};
}
}
sep = "&";
}
- if (url->page != -1) {
- if (tp_writef(c->tp, "%spage=%d", sep, url->page) == -1)
- return -1;
- sep = "&";
- }
-
return 0;
}
blob - c6f6315c469836e4424a9d92b00e6adf8fe10965
blob + 4ac6df645c49875304c9cd6afec8cff0c4b8f3b2
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
struct gotweb_url {
int action;
int index_page;
- int page;
const char *commit;
const char *previd;
const char *prevset;
char *headref;
int index_page;
char *path;
- int page;
};
struct querystring_keys {
HEADREF,
INDEX_PAGE,
PATH,
- PAGE,
};
enum query_actions {
blob - a55f8da771b11abd364a24ae8e9f6fc22975d62c
blob + f5ec9427b8109fc6f4060a3c56f7a842acf8bd5a
--- gotwebd/pages.tmpl
+++ gotwebd/pages.tmpl
memset(&url, 0, sizeof(url));
url.index_page = -1;
- url.page = -1;
url.action = TREE;
url.path = qs->path;
url.commit = qs->commit;
memset(&u_path, 0, sizeof(u_path));
u_path.index_page = -1;
- u_path.page = -1;
u_path.action = SUMMARY;
!}
<!doctype html>
struct gotweb_url summary = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, briefs = {
.action = BRIEFS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, commits = {
.action = COMMITS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, tags = {
.action = TAGS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, tree = {
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, rss = {
.action = RSS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
diff_url = (struct gotweb_url){
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
patch_url = (struct gotweb_url){
.action = PATCH,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
tree_url = (struct gotweb_url){
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
diff = (struct gotweb_url){
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
patch = (struct gotweb_url){
.action = PATCH,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
tree = (struct gotweb_url){
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
memset(&briefs_url, 0, sizeof(briefs_url));
briefs_url.index_page = -1,
- briefs_url.page = -1,
briefs_url.action = BRIEFS,
briefs_url.path = qs->path,
briefs_url.commit = qs->commit,
memset(&url, 0, sizeof(url));
url.index_page = -1;
- url.page = -1;
url.action = BLOB;
url.path = t->qs->path;
url.file = readme;
mode_t mode;
struct gotweb_url url = {
.index_page = -1,
- .page = -1,
.commit = rc->commit_id,
.path = qs->path,
};
struct gotweb_url url = {
.action = TAG,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = rt->commit_id,
};
struct gotweb_url patch_url, tree_url = {
.action = TREE,
.index_page = -1,
- .page = -1,
.path = qs->path,
.commit = rc->commit_id,
};
struct gotweb_url url = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = qs->path,
};
memset(&briefs_url, 0, sizeof(briefs_url));
briefs_url.index_page = -1,
- briefs_url.page = -1,
briefs_url.action = BRIEFS,
briefs_url.path = qs->path,
briefs_url.commit = qs->commit,
struct gotweb_url url = {
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = bline->id_str,
};
struct gotweb_url summary = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
struct gotweb_url tag = {
.action = TAG,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = rt->commit_id,
};