"Alex Riesen" [off-list ref] writes:
On 6/9/07, Johan Herland [off-list ref] wrote:
quoted
This patch introduces a new optional header line to the tag object, called
"keywords". The "keywords" line may contain a comma-separated list of
custom keywords associated with the tag object.
What is the character set for the keywords?
quoted
+ for (i = 0; i < keywords_len; ++i) {
+ unsigned char c = keywords_line[i];
+ if (c == ',' && keywords_line[i + 1] == ',')
+ /* consecutive commas */
+ return error("Tag object (@ char "
+ PD_FMT "): Found empty keyword",
+ keywords_line + i - data);
+ if (c > ' ' && c != 0x7f)
+ continue;
And what is so special about 0x7f?
It is DEL, but as the code uses uchar, it probably also error on
0x80 or higher, if the intent is "printable ASCII".
Signed-off-by: Johan Herland <redacted>
---
On Sunday 10 June 2007, Junio C Hamano wrote:
"Alex Riesen" [off-list ref] writes:
quoted
And what is so special about 0x7f?
It is DEL, but as the code uses uchar, it probably also error on
0x80 or higher, if the intent is "printable ASCII".
Is this better?
...Johan
tag.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tag.c b/tag.c
index 2307ec9..2b92465 100644
--- a/tag.c
+++ b/tag.c
@@ -183,8 +183,8 @@ int parse_and_verify_tag_buffer(struct tag *item,
/* Verify tag name: disallow control characters or spaces */
if (tag_len) { /* tag name was given */
for (i = 0; i < tag_len; ++i) {
- unsigned char c = tag_line[i];
- if (c > ' ' && c != 0x7f)
+ char c = tag_line[i];
+ if (c > ' ' && c < 0x7f)
continue;
return FAIL("Tag object (@ char " PD_FMT "): "
"Could not verify tag name",@@ -198,13 +198,13 @@ int parse_and_verify_tag_buffer(struct tag *item,
*/
if (keywords_len) { /* keywords line was given */
for (i = 0; i < keywords_len; ++i) {
- unsigned char c = keywords_line[i];
+ char c = keywords_line[i];
if (c == ',' && keywords_line[i + 1] == ',')
/* consecutive commas */
return FAIL("Tag object (@ char "
PD_FMT "): Found empty keyword",
keywords_line + i - data);
- if (c > ' ' && c != 0x7f)
+ if (c > ' ' && c < 0x7f)
continue;
return FAIL("Tag object (@ char " PD_FMT "): "
"Could not verify keywords",--
1.5.2.1.144.gabc40