summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2007-06-10 18:13:59 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2007-06-10 18:13:59 +0000
commit9ef3a2cd577cb45e6d68b691f39e4ada91417bb8 (patch)
tree926cc87fa8c583ee16070d308ae8c9caf6774f8c /utils
parente671fe37078340b71f4829d95e242c9f6005648a (diff)
downloadnetsurf-9ef3a2cd577cb45e6d68b691f39e4ada91417bb8.tar.gz
netsurf-9ef3a2cd577cb45e6d68b691f39e4ada91417bb8.tar.bz2
Reflow useragent.c to be 8 char indent. Also rename build_user_agent to user_agent_build_string so that all useragent.c starts user_agent_*
svn path=/trunk/netsurf/; revision=3334
Diffstat (limited to 'utils')
-rw-r--r--utils/useragent.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/utils/useragent.c b/utils/useragent.c
index 085557d7e..4decb7736 100644
--- a/utils/useragent.c
+++ b/utils/useragent.c
@@ -23,46 +23,46 @@ static const char *core_user_agent_string = NULL;
* user agent in HTTP requests.
*/
static void
-build_user_agent(void)
+user_agent_build_string(void)
{
- struct utsname un;
- const char *sysname = "Unknown";
- const char *machine = "Unknown";
- char *ua_string;
- int len;
+ 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;
- }
+ if (uname(&un) == 0) {
+ sysname = un.sysname;
+ machine = un.machine;
+ }
- len = snprintf(NULL, 0, NETSURF_UA_FORMAT_STRING,
+ len = snprintf(NULL, 0, NETSURF_UA_FORMAT_STRING,
+ netsurf_version_major,
+ netsurf_version_minor,
+ sysname,
+ machine);
+ ua_string = malloc(len + 1);
+ if (!ua_string) {
+ /** \todo this needs handling better */
+ return;
+ }
+ snprintf(ua_string, len + 1,
+ NETSURF_UA_FORMAT_STRING,
netsurf_version_major,
netsurf_version_minor,
sysname,
machine);
- ua_string = malloc(len + 1);
- if (!ua_string) {
- /** \todo this needs handling better */
- return;
- }
- snprintf(ua_string, len + 1,
- NETSURF_UA_FORMAT_STRING,
- netsurf_version_major,
- netsurf_version_minor,
- sysname,
- machine);
- core_user_agent_string = ua_string;
+ core_user_agent_string = ua_string;
- LOG(("Built user agent \"%s\"", core_user_agent_string));
+ LOG(("Built user agent \"%s\"", core_user_agent_string));
}
/* This is a function so that later we can override it trivially */
const char *
user_agent_string(void)
{
- if (core_user_agent_string == NULL)
- build_user_agent();
- return core_user_agent_string;
+ if (core_user_agent_string == NULL)
+ user_agent_build_string();
+ return core_user_agent_string;
}