Remove architecture from UA string.

This commit is contained in:
Michael Drake 2013-01-14 13:59:07 +00:00
parent 96264ca71e
commit 4e756f6088
2 changed files with 5 additions and 9 deletions

View File

@ -78,9 +78,9 @@ NETSURF_USE_HARU_PDF := NO
NETSURF_STRIP_BINARY := NO
# Template used for constructing the User Agent: string. The first two
# replacements are major/minor version, second two are OS and architecture.
# replacements are major/minor version, next is OS.
# Please don't be tempted to mention Mozilla here! Let's let that lie die.
NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s; %s)"
NETSURF_UA_FORMAT_STRING := "NetSurf/%d.%d (%s)"
# Default home page, if one is not defined by the user. Note that this
# option does not apply to the RISC OS version, as it has its own local

View File

@ -29,7 +29,7 @@
static const char *core_user_agent_string = NULL;
#ifndef NETSURF_UA_FORMAT_STRING
#define NETSURF_UA_FORMAT_STRING "NetSurf/%d.%d (%s; %s)"
#define NETSURF_UA_FORMAT_STRING "NetSurf/%d.%d (%s)"
#endif
/**
@ -41,20 +41,17 @@ user_agent_build_string(void)
{
struct utsname un;
const char *sysname = "Unknown";
const char *machine = "Unknown";
char *ua_string;
int len;
if (uname(&un) >= 0) {
sysname = un.sysname;
machine = un.machine;
}
len = snprintf(NULL, 0, NETSURF_UA_FORMAT_STRING,
netsurf_version_major,
netsurf_version_minor,
sysname,
machine);
sysname);
ua_string = malloc(len + 1);
if (!ua_string) {
/** \todo this needs handling better */
@ -64,8 +61,7 @@ user_agent_build_string(void)
NETSURF_UA_FORMAT_STRING,
netsurf_version_major,
netsurf_version_minor,
sysname,
machine);
sysname);
core_user_agent_string = ua_string;