about summary refs log tree commit diff
path: root/nss/getent.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-09-12 07:10:59 +0000
committerJakub Jelinek <jakub@redhat.com>2005-09-12 07:10:59 +0000
commit5e6e144e096c83beefb5bd50ea22da7266e72aee (patch)
tree80b4ba2f5794225b6f0dbee4171394423dc82cf2 /nss/getent.c
parent753ea4414a6a5994cf156d9a11582d18a1fb2a6f (diff)
downloadglibc-5e6e144e096c83beefb5bd50ea22da7266e72aee.tar.gz
glibc-5e6e144e096c83beefb5bd50ea22da7266e72aee.tar.xz
glibc-5e6e144e096c83beefb5bd50ea22da7266e72aee.zip
Updated to fedora-glibc-20050912T0656
Diffstat (limited to 'nss/getent.c')
-rw-r--r--nss/getent.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/nss/getent.c b/nss/getent.c
index 7124e6303f..02bba39752 100644
--- a/nss/getent.c
+++ b/nss/getent.c
@@ -21,22 +21,23 @@
 
 #include <aliases.h>
 #include <argp.h>
-#include <grp.h>
-#include <pwd.h>
-#include <shadow.h>
 #include <ctype.h>
 #include <error.h>
+#include <grp.h>
 #include <libintl.h>
 #include <locale.h>
+#include <mcheck.h>
 #include <netdb.h>
+#include <pwd.h>
+#include <shadow.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/ether.h>
 #include <arpa/inet.h>
 #include <arpa/nameser.h>
+#include <netinet/ether.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
 
 /* Get libc version number.  */
 #include <version.h>
@@ -410,6 +411,8 @@ netgroup_keys (int number, char *key[])
 	}
     }
 
+  endnetgrent ();
+
   return result;
 }
 
@@ -838,7 +841,8 @@ more_help (int key, const char *text, void *input)
 int
 main (int argc, char *argv[])
 {
-  int remaining, i;
+  /* Debugging support.  */
+  mtrace ();
 
   /* Set locale via LC_ALL.  */
   setlocale (LC_ALL, "");
@@ -846,6 +850,7 @@ main (int argc, char *argv[])
   textdomain (PACKAGE);
 
   /* Parse and process arguments.  */
+  int remaining;
   argp_parse (&argp, argc, argv, 0, &remaining, NULL);
 
   if ((argc - remaining) < 1)
@@ -855,7 +860,7 @@ main (int argc, char *argv[])
       return 1;
     }
 
-  for (i = 0; databases[i].name; ++i)
+  for (int i = 0; databases[i].name; ++i)
     if (argv[remaining][0] == databases[i].name[0]
 	&& !strcmp (argv[remaining], databases[i].name))
       return databases[i].func (argc - remaining - 1, &argv[remaining + 1]);