summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-09-06 01:41:56 +0000
committerBruce Momjian <bruce@momjian.us>2003-09-06 01:41:56 +0000
commit4060f07578a2e6e1741b70f990c7a0e373a5365e (patch)
treecae8faa0b2373e8a66184b1c28eefdd955b81c55
parent92aa462247f361495660240fef22524552906866 (diff)
downloadpostgresql-4060f07578a2e6e1741b70f990c7a0e373a5365e.tar.gz
Rename variables for clarity.
-rw-r--r--src/bin/pg_id/pg_id.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/bin/pg_id/pg_id.c b/src/bin/pg_id/pg_id.c
index b8046e93ad..739c47a27a 100644
--- a/src/bin/pg_id/pg_id.c
+++ b/src/bin/pg_id/pg_id.c
@@ -6,7 +6,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.22 2003/08/09 01:25:46 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_id/Attic/pg_id.c,v 1.23 2003/09/06 01:41:56 momjian Exp $
*/
#include "postgres_fe.h"
@@ -24,9 +24,9 @@ int
main(int argc, char *argv[])
{
int c;
- int nameflag = 0,
- realflag = 0,
- userflag = 0;
+ int name_only_flag = 0,
+ use_real_uid_flag = 0,
+ limit_user_info = 0;
const char *username = NULL;
struct passwd *pw;
@@ -38,13 +38,13 @@ main(int argc, char *argv[])
switch (c)
{
case 'n':
- nameflag = 1;
+ name_only_flag = 1;
break;
case 'r':
- realflag = 1;
+ use_real_uid_flag = 1;
break;
case 'u':
- userflag = 1;
+ limit_user_info = 1;
break;
default:
fprintf(stderr, "Usage: %s [-n] [-r] [-u] [username]\n", argv[0]);
@@ -55,12 +55,12 @@ main(int argc, char *argv[])
if (argc - optind >= 1)
username = argv[optind];
- if (nameflag && !userflag)
+ if (name_only_flag && !limit_user_info)
{
fprintf(stderr, "%s: -n must be used together with -u\n", argv[0]);
exit(1);
}
- if (username && realflag)
+ if (username && use_real_uid_flag)
{
fprintf(stderr, "%s: -r cannot be used when a user name is given\n", argv[0]);
exit(1);
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
exit(1);
}
}
- else if (realflag)
+ else if (use_real_uid_flag)
pw = getpwuid(getuid());
else
pw = getpwuid(geteuid());
@@ -87,9 +87,9 @@ main(int argc, char *argv[])
exit(1);
}
- if (!userflag)
+ if (!limit_user_info)
printf("uid=%d(%s)\n", (int) pw->pw_uid, pw->pw_name);
- else if (nameflag)
+ else if (name_only_flag)
puts(pw->pw_name);
else
#ifdef __BEOS__