projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Restrict usernames to the same character set as tags
[blerg.git]
/
database
/
tags.c
diff --git
a/database/tags.c
b/database/tags.c
index
a28df02
..
51d8698
100644
(file)
--- a/
database/tags.c
+++ b/
database/tags.c
@@
-12,10
+12,9
@@
#include <sys/mman.h>
#include "tags.h"
#include "util.h"
#include <sys/mman.h>
#include "tags.h"
#include "util.h"
+#include "database.h"
#include "config.h"
#include "config.h"
-#define TAG_CHAR(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_')
-#define WHITESPACE(c) (c == ' ' || c == '\t' || c == '\n' || c == '\r')
int tag_scan(const char *author, const char *data, int len, uint64_t record) {
char *taglist[MAX_TAGS_PER_RECORD];
int tag_scan(const char *author, const char *data, int len, uint64_t record) {
char *taglist[MAX_TAGS_PER_RECORD];
@@
-32,7
+31,7
@@
tag_scan_start:
}
int begin = i;
int start = ++i;
}
int begin = i;
int start = ++i;
- while (i < len &&
TAG
_CHAR(data[i]) && (i - start < MAX_TAG_LENGTH)) {
+ while (i < len &&
VALID
_CHAR(data[i]) && (i - start < MAX_TAG_LENGTH)) {
i++;
}
if (start - i == 0) continue;
i++;
}
if (start - i == 0) continue;