httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net!
This commit is contained in:
parent
6c85ddc850
commit
fcdb00f735
@ -64,7 +64,7 @@ int main(int argc, char **argv)
|
|||||||
for (s = applet_name; *s ;)
|
for (s = applet_name; *s ;)
|
||||||
if (*(s++) == '/') applet_name = s;
|
if (*(s++) == '/') applet_name = s;
|
||||||
|
|
||||||
/* Set locale for everybody except `init' */
|
/* Set locale for everybody except 'init' */
|
||||||
if (ENABLE_LOCALE_SUPPORT && getpid() != 1)
|
if (ENABLE_LOCALE_SUPPORT && getpid() != 1)
|
||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
|
|
||||||
|
@ -87,9 +87,10 @@ int cal_main(int argc, char **argv)
|
|||||||
char day_headings[28]; /* 28 for julian, 21 for nonjulian */
|
char day_headings[28]; /* 28 for julian, 21 for nonjulian */
|
||||||
char buf[40];
|
char buf[40];
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
// Done in busybox.c, ok to remove?
|
||||||
setlocale(LC_TIME, "");
|
//#ifdef CONFIG_LOCALE_SUPPORT
|
||||||
#endif
|
// setlocale(LC_TIME, "");
|
||||||
|
//#endif
|
||||||
|
|
||||||
flags = getopt32(argc, argv, "jy");
|
flags = getopt32(argc, argv, "jy");
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@
|
|||||||
#include "busybox.h"
|
#include "busybox.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
#ifdef CONFIG_LOCALE_SUPPORT
|
||||||
#include <locale.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#define isspace_given_isprint(c) isspace(c)
|
#define isspace_given_isprint(c) isspace(c)
|
||||||
#else
|
#else
|
||||||
#undef isspace
|
#undef isspace
|
||||||
|
@ -846,9 +846,11 @@ static int sendHeaders(HttpResponseNum responseNum)
|
|||||||
time_t timer = time(0);
|
time_t timer = time(0);
|
||||||
char timeStr[80];
|
char timeStr[80];
|
||||||
int len;
|
int len;
|
||||||
|
enum {
|
||||||
|
numNames = sizeof(httpResponseNames) / sizeof(httpResponseNames[0])
|
||||||
|
};
|
||||||
|
|
||||||
for (i = 0;
|
for (i = 0; i < numNames; i++) {
|
||||||
i < (sizeof(httpResponseNames)/sizeof(httpResponseNames[0])); i++) {
|
|
||||||
if (httpResponseNames[i].type == responseNum) {
|
if (httpResponseNames[i].type == responseNum) {
|
||||||
responseString = httpResponseNames[i].name;
|
responseString = httpResponseNames[i].name;
|
||||||
infoString = httpResponseNames[i].info;
|
infoString = httpResponseNames[i].info;
|
||||||
@ -1177,7 +1179,7 @@ static int sendCgi(const char *url,
|
|||||||
# error "PIPESIZE >= MAX_MEMORY_BUFF"
|
# error "PIPESIZE >= MAX_MEMORY_BUFF"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// There is something to read
|
/* There is something to read */
|
||||||
count = safe_read(inFd, rbuf, PIPESIZE);
|
count = safe_read(inFd, rbuf, PIPESIZE);
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
break; /* closed */
|
break; /* closed */
|
||||||
@ -1197,7 +1199,7 @@ static int sendCgi(const char *url,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
fprintf(stderr, "cgi read %d bytes\n", count);
|
fprintf(stderr, "cgi read %d bytes: '%.*s'\n", count, count, rbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1838,6 +1840,11 @@ int httpd_main(int argc, char *argv[])
|
|||||||
USE_FEATURE_HTTPD_SETUID(struct bb_uidgid_t ugid;)
|
USE_FEATURE_HTTPD_SETUID(struct bb_uidgid_t ugid;)
|
||||||
USE_FEATURE_HTTPD_AUTH_MD5(const char *pass;)
|
USE_FEATURE_HTTPD_AUTH_MD5(const char *pass;)
|
||||||
|
|
||||||
|
#if ENABLE_LOCALE_SUPPORT
|
||||||
|
/* Undo busybox.c: we want to speak English in http (dates etc) */
|
||||||
|
setlocale(LC_TIME, "C");
|
||||||
|
#endif
|
||||||
|
|
||||||
config = xzalloc(sizeof(*config));
|
config = xzalloc(sizeof(*config));
|
||||||
#if ENABLE_FEATURE_HTTPD_BASIC_AUTH
|
#if ENABLE_FEATURE_HTTPD_BASIC_AUTH
|
||||||
config->realm = "Web Server Authentication";
|
config->realm = "Web Server Authentication";
|
||||||
|
@ -1495,7 +1495,6 @@ static void getoptsreset(const char *);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
#ifdef CONFIG_LOCALE_SUPPORT
|
||||||
#include <locale.h>
|
|
||||||
static void change_lc_all(const char *value);
|
static void change_lc_all(const char *value);
|
||||||
static void change_lc_ctype(const char *value);
|
static void change_lc_ctype(const char *value);
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,10 +25,6 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#include "cmdedit.h"
|
#include "cmdedit.h"
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
|
||||||
#include <locale.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#define expand_t glob_t
|
#define expand_t glob_t
|
||||||
|
|
||||||
@ -377,6 +373,7 @@ static int builtin_export(struct child_prog *child)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_LOCALE_SUPPORT
|
#ifdef CONFIG_LOCALE_SUPPORT
|
||||||
|
// TODO: why getenv? "" would be just as good...
|
||||||
if(strncmp(v, "LC_ALL=", 7)==0)
|
if(strncmp(v, "LC_ALL=", 7)==0)
|
||||||
setlocale(LC_ALL, getenv("LC_ALL"));
|
setlocale(LC_ALL, getenv("LC_ALL"));
|
||||||
if(strncmp(v, "LC_CTYPE=", 9)==0)
|
if(strncmp(v, "LC_CTYPE=", 9)==0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user