tzdata: update bbappend for 2013i
[opendreambox.git] / meta-opendreambox / recipes-devtools / opkg / opkg / 0010-fixed-broken-uname-gname-cache-this-significantly-sp.patch
1 From 1e14650f6dd1008d57cf6e6c350a5554f2ca7056 Mon Sep 17 00:00:00 2001
2 From: Andreas Monzner <andreas.monzner@dream-property.net>
3 Date: Tue, 5 Mar 2013 22:20:20 +0100
4 Subject: [PATCH 10/19] fixed broken uname gname cache (this significantly
5  speeds up)
6 To: opkg-devel@googlegroups.com
7 Cc: paul@paulbarker.me.uk
8
9 ---
10  libbb/unarchive.c | 8 ++++----
11  1 file changed, 4 insertions(+), 4 deletions(-)
12
13 diff --git a/libbb/unarchive.c b/libbb/unarchive.c
14 index d583767..89447d4 100644
15 --- a/libbb/unarchive.c
16 +++ b/libbb/unarchive.c
17 @@ -446,12 +446,12 @@ static bool update_unamecache(char *uname) {
18         struct passwd *passwd;
19         if (!uname)
20                 return FALSE;
21 -       if (!uname_cache[0] && strcmp(uname_cache, uname) == 0)
22 +       if (!strcmp(uname_cache, uname))
23                 return TRUE;
24         passwd = getpwnam(uname);
25         if (passwd) {
26                 uid_cache = passwd->pw_uid;
27 -               strncpy(uname, uname_cache, 32);
28 +               strncpy(uname_cache, uname, 32);
29                 return TRUE;
30         }
31         return FALSE;
32 @@ -464,12 +464,12 @@ static bool update_gnamecache(char *gname) {
33         struct group *group;
34         if (!gname)
35                 return FALSE;
36 -       if (!gname_cache[0] && strcmp(gname_cache, gname) == 0)
37 +       if (!strcmp(gname_cache, gname))
38                 return TRUE;
39         group = getgrnam(gname);
40         if (group) {
41                 gid_cache = group->gr_gid;
42 -               strncpy(gname, gname_cache, 32);
43 +               strncpy(gname_cache, gname, 32);
44                 return TRUE;
45         }
46         return FALSE;
47 -- 
48 1.9.1
49