Skip to content

Commit

Permalink
Fixed issue where HTML bar graphs were not shown due to LC_NUMERIC.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed May 24, 2014
1 parent 8c439b9 commit 029b472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion goaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,6 @@ set_locale (void)
setlocale (LC_CTYPE, loc_ctype);
else
setlocale (LC_CTYPE, "");
setlocale (LC_NUMERIC, "");
}

static void
Expand Down
3 changes: 3 additions & 0 deletions ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include <locale.h>

#include "ui.h"

Expand Down Expand Up @@ -699,13 +700,15 @@ ui_spinner (void *ptr_data)
if (sp->state == SPN_END)
break;

setlocale (LC_NUMERIC, "");
if (conf.no_progress) {
snprintf (buf, sizeof buf, SPIN_FMT, sp->label);
} else {
tdiff = (long long) (time (NULL) - begin);
psec = tdiff >= 1 ? *(sp->process) / tdiff : 0;
snprintf (buf, sizeof buf, SPIN_FMTM, sp->label, *(sp->process), psec);
}
setlocale (LC_NUMERIC, "POSIX");

/* CURSES */
if (sp->curses) {
Expand Down

0 comments on commit 029b472

Please sign in to comment.