index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2017-05-10 18:54:56 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2017-05-16 12:43:17 +1000 |
commit | 63087c31b5bdd7a16d312d9bf938f6cfd4a635b0 (patch) | |
tree | 04afced797a7c357ce6dba1602dfb61313737ed9 | |
parent | a2b776f6c901c706946b49d2b5cadb0c6efd2655 (diff) |
-rw-r--r-- | src/pacman/pacman.c | 7 |
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 605aec3e..11b7e6f0 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -271,10 +271,15 @@ static void setuseragent(void) { char agent[101]; struct utsname un; + int len; uname(&un); - snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s", + len = snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s", PACKAGE_VERSION, un.sysname, un.machine, alpm_version()); + if(len >= 100) { + pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n")); + } + setenv("HTTP_USER_AGENT", agent, 0); } |