fix bindtextdomain logic error deactivating other domains
authorRich Felker <dalias@aerifal.cx>
Sun, 29 Jan 2017 05:11:23 +0000 (00:11 -0500)
committerRich Felker <dalias@aerifal.cx>
Sun, 29 Jan 2017 05:11:23 +0000 (00:11 -0500)
this loop was only supposed to deactivate other bindings for the same
text domain name, but due to copy-and-paste error, deactivated all
other bindings.

patch by He X.

src/locale/dcngettext.c

index a5ff847504f58a5904dc2a949e73a354661f3a08..e48c50f03a2e936e58a5dbf5d667b393372e77a3 100644 (file)
@@ -74,7 +74,7 @@ char *bindtextdomain(const char *domainname, const char *dirname)
        a_store(&p->active, 1);
 
        for (q=bindings; q; q=q->next) {
-               if (!strcmp(p->domainname, domainname) && q != p)
+               if (!strcmp(q->domainname, domainname) && q != p)
                        a_store(&q->active, 0);
        }