Delete duplicate lines
authorTopi Miettinen <toiwoton@gmail.com>
Sat, 5 Jan 2019 18:37:34 +0000 (20:37 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 12 Jan 2019 15:02:26 +0000 (16:02 +0100)
commit7ae3561a5a6c85b080808335f0dd8f137acd5ba8
treeb03da7c5056c7009763b64f1ce92419832dbc94d
parent899072c0cd2edcb29bcaed81414ae86b2363f2bc
Delete duplicate lines

Found by inspecting results of running this small program:

int main(int argc, const char **argv) {
for (int i = 1; i < argc; i++) {
FILE *f;
char line[1024], prev[1024], *r;
int lineno;

prev[0] = '\0';
lineno = 1;
f = fopen(argv[i], "r");
if (!f)
exit(1);
do {
r = fgets(line, sizeof(line), f);
if (!r)
break;
if (strcmp(line, prev) == 0)
printf("%s:%d: error: dup %s", argv[i], lineno, line);
lineno++;
strcpy(prev, line);
} while (!feof(f));
fclose(f);
}
}
16 files changed:
src/analyze/analyze-security.c
src/basic/hashmap.h
src/core/bpf-devices.c
src/journal/journald-wall.h
src/journal/sd-journal.c
src/libsystemd-network/sd-ndisc.c
src/libsystemd/sd-resolve/sd-resolve.c
src/network/networkd-dhcp6.c
src/systemd/sd-netlink.h
src/test/test-hexdecoct.c
src/test/test-json.c
src/test/test-mountpoint-util.c
src/test/test-stat-util.c
src/test/test-time-util.c
src/udev/udev-builtin-path_id.c
src/udev/udevadm-info.c