gentoo/dev-libs/ossp-uuid/files/ossp-uuid-1.6.2-uuid-preserve-m-option-status-in-v-option-handling.patch
Robin H. Johnson 56bd759df1
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.

This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.

Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
2015-08-08 17:38:18 -07:00

56 lines
2.5 KiB
Diff

From: Marco Nenciarini <marco.nenciarini@devise.it>
Date: Wed, 27 Jan 2010 19:46:21 +0100
Subject: [PATCH] uuid: preserve -m option status in -v option handling
Bug: 531396
---
uuid_cli.c | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/uuid_cli.c b/uuid_cli.c
index d1b0b11..14a67fe 100644
--- a/uuid_cli.c
+++ b/uuid_cli.c
@@ -140,11 +140,12 @@ int main(int argc, char *argv[])
i = strtol(optarg, &p, 10);
if (*p != '\0')
usage("invalid argument to option 'v'");
+ version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5);
switch (i) {
- case 1: version = UUID_MAKE_V1; break;
- case 3: version = UUID_MAKE_V3; break;
- case 4: version = UUID_MAKE_V4; break;
- case 5: version = UUID_MAKE_V5; break;
+ case 1: version |= UUID_MAKE_V1; break;
+ case 3: version |= UUID_MAKE_V3; break;
+ case 4: version |= UUID_MAKE_V4; break;
+ case 5: version |= UUID_MAKE_V5; break;
default:
usage("invalid version on option 'v'");
break;
@@ -213,10 +214,10 @@ int main(int argc, char *argv[])
}
else {
/* encoding */
- if ( (version == UUID_MAKE_V1 && argc != 0)
- || (version == UUID_MAKE_V3 && argc != 2)
- || (version == UUID_MAKE_V4 && argc != 0)
- || (version == UUID_MAKE_V5 && argc != 2))
+ if ( (version & UUID_MAKE_V1 && argc != 0)
+ || (version & UUID_MAKE_V3 && argc != 2)
+ || (version & UUID_MAKE_V4 && argc != 0)
+ || (version & UUID_MAKE_V5 && argc != 2))
usage("invalid number of arguments");
if ((rc = uuid_create(&uuid)) != UUID_RC_OK)
error(1, "uuid_create: %s", uuid_error(rc));
@@ -232,7 +233,7 @@ int main(int argc, char *argv[])
if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK)
error(1, "uuid_load: %s", uuid_error(rc));
}
- if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
+ if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) {
if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK)
error(1, "uuid_create: %s", uuid_error(rc));
if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
--