summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 6ad8f118a1..0c85fc5957 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -3278,6 +3278,13 @@ static bool write_tag(int fd, const char *tagstr, const char *datastr)
3278 if (*datastr == '"' || *datastr == '\\') 3278 if (*datastr == '"' || *datastr == '\\')
3279 buf[i++] = '\\'; 3279 buf[i++] = '\\';
3280 3280
3281 else if (*datastr == '\n')
3282 {
3283 buf[i++] = '\\';
3284 buf[i] = 'n';
3285 continue;
3286 }
3287
3281 buf[i] = *(datastr++); 3288 buf[i] = *(datastr++);
3282 } 3289 }
3283 3290
@@ -3335,12 +3342,18 @@ static bool read_tag(char *dest, long size,
3335 3342
3336 if (*src == '\\') 3343 if (*src == '\\')
3337 { 3344 {
3338 dest[pos] = *(src+1); 3345 src++;
3339 src += 2; 3346 if (*src == 'n')
3347 dest[pos] = '\n';
3348 else
3349 dest[pos] = *src;
3350
3351 src++;
3340 continue; 3352 continue;
3341 } 3353 }
3342 3354
3343 dest[pos] = *src; 3355 if (*src == '\0')
3356 break;
3344 3357
3345 if (*src == '"') 3358 if (*src == '"')
3346 { 3359 {
@@ -3348,10 +3361,7 @@ static bool read_tag(char *dest, long size,
3348 break; 3361 break;
3349 } 3362 }
3350 3363
3351 if (*src == '\0') 3364 dest[pos] = *(src++);
3352 break;
3353
3354 src++;
3355 } 3365 }
3356 3366
3357 dest[pos] = '\0'; 3367 dest[pos] = '\0';
@@ -3377,10 +3387,10 @@ static int parse_changelog_line(int line_n, const char *buf, void *parameters)
3377 if (*buf == '#') 3387 if (*buf == '#')
3378 return 0; 3388 return 0;
3379 3389
3380 logf("%d/%s", line_n, buf); 3390 /* logf("%d/%s", line_n, buf); */
3381 if (!read_tag(tag_data, sizeof tag_data, buf, "filename")) 3391 if (!read_tag(tag_data, sizeof tag_data, buf, "filename"))
3382 { 3392 {
3383 logf("filename missing"); 3393 logf("%d/filename missing", line_n);
3384 logf("-> %s", buf); 3394 logf("-> %s", buf);
3385 return 0; 3395 return 0;
3386 } 3396 }
@@ -3388,13 +3398,13 @@ static int parse_changelog_line(int line_n, const char *buf, void *parameters)
3388 idx_id = find_index(tag_data); 3398 idx_id = find_index(tag_data);
3389 if (idx_id < 0) 3399 if (idx_id < 0)
3390 { 3400 {
3391 logf("entry not found"); 3401 logf("%d/entry not found", line_n);
3392 return 0; 3402 return 0;
3393 } 3403 }
3394 3404
3395 if (!get_index(masterfd, idx_id, &idx, false)) 3405 if (!get_index(masterfd, idx_id, &idx, false))
3396 { 3406 {
3397 logf("failed to retrieve index entry"); 3407 logf("%d/failed to retrieve index entry", line_n);
3398 return 0; 3408 return 0;
3399 } 3409 }
3400 3410
@@ -3402,7 +3412,7 @@ static int parse_changelog_line(int line_n, const char *buf, void *parameters)
3402 if (idx.flag & FLAG_DIRTYNUM) 3412 if (idx.flag & FLAG_DIRTYNUM)
3403 return 0; 3413 return 0;
3404 3414
3405 logf("import: %s", tag_data); 3415 logf("%d/import: %s", line_n, tag_data);
3406 3416
3407 idx.flag |= FLAG_DIRTYNUM; 3417 idx.flag |= FLAG_DIRTYNUM;
3408 for (i = 0; i < (long)(sizeof(import_tags)/sizeof(import_tags[0])); i++) 3418 for (i = 0; i < (long)(sizeof(import_tags)/sizeof(import_tags[0])); i++)