version 1.25, 2019/07/27 13:40:57 |
version 1.26, 2020/01/19 18:02:00 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2015, 2016, 2018, 2019 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze <schwarze@openbsd.org> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 196 tag_put(const char *s, int prio, size_t line) |
|
Line 196 tag_put(const char *s, int prio, size_t line) |
|
|
|
/* A better entry is already present, ignore the new one. */ |
/* A better entry is already present, ignore the new one. */ |
|
|
if (entry->prio > 0 && entry->prio < prio) |
if (entry->prio != -1 && entry->prio < prio) |
return; |
return; |
|
|
/* The existing entry is worse, clear it. */ |
/* The existing entry is worse, clear it. */ |
|
|
if (entry->prio < 1 || entry->prio > prio) |
if (entry->prio == -1 || entry->prio == 0 || |
|
entry->prio > prio) |
entry->nlines = 0; |
entry->nlines = 0; |
} |
} |
|
|
|
|
empty = 1; |
empty = 1; |
entry = ohash_first(&tag_data, &slot); |
entry = ohash_first(&tag_data, &slot); |
while (entry != NULL) { |
while (entry != NULL) { |
if (stream != NULL && entry->prio >= 0) { |
if (stream != NULL && entry->prio != -1) { |
for (i = 0; i < entry->nlines; i++) { |
for (i = 0; i < entry->nlines; i++) { |
fprintf(stream, "%s %s %zu\n", |
fprintf(stream, "%s %s %zu\n", |
entry->s, tag_files.ofn, entry->lines[i]); |
entry->s, tag_files.ofn, entry->lines[i]); |