Skip to content

Commit

Permalink
options.c: Fix conf.filenames duplication problem if logs are via pipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
TerraTech committed Sep 30, 2017
1 parent efbffb3 commit 0365f2e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,13 @@ verify_global_config (int argc, char **argv)
void
add_dash_filename (void)
{
int i;
// pre-scan for '-' and don't add if already exists: github.com/allinurl/goaccess/issues/907
for (i = 0; i < conf.filenames_idx; ++i) {
if (conf.filenames[i][0] == '-' && conf.filenames[i][1] == '\0')
return;
}

if (conf.filenames_idx < MAX_FILENAMES && !conf.read_stdin) {
conf.read_stdin = 1;
conf.filenames[conf.filenames_idx++] = "-";
Expand Down

0 comments on commit 0365f2e

Please sign in to comment.