cgit.c: Fix comment on bit mask hack

* Formatting and spelling fixes.

* A bit mask with the size of one byte only allows for storing 8 (not
  255!) different flags.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-01-10 14:55:31 +01:00 committed by Jason A. Donenfeld
parent 441e748564
commit c96becc1e5

18
cgit.c
View File

@ -885,14 +885,16 @@ static void cgit_parse_args(int argc, const char **argv)
ctx.qry.ofs = atoi(argv[i] + 6); ctx.qry.ofs = atoi(argv[i] + 6);
} else if (!prefixcmp(argv[i], "--scan-tree=") || } else if (!prefixcmp(argv[i], "--scan-tree=") ||
!prefixcmp(argv[i], "--scan-path=")) { !prefixcmp(argv[i], "--scan-path=")) {
/* HACK: the global snapshot bitmask defines the /*
* set of allowed snapshot formats, but the config * HACK: The global snapshot bit mask defines the set
* file hasn't been parsed yet so the mask is * of allowed snapshot formats, but the config file
* currently 0. By setting all bits high before * hasn't been parsed yet so the mask is currently 0.
* scanning we make sure that any in-repo cgitrc * By setting all bits high before scanning we make
* snapshot setting is respected by scan_tree(). * sure that any in-repo cgitrc snapshot setting is
* BTW: we assume that there'll never be more than * respected by scan_tree().
* 255 different snapshot formats supported by cgit... *
* NOTE: We assume that there aren't more than 8
* different snapshot formats supported by cgit...
*/ */
ctx.cfg.snapshots = 0xFF; ctx.cfg.snapshots = 0xFF;
scan++; scan++;