OSSP CVS Repository

ossp - Check-in [4363]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4363
Date: 2004-Jan-17 15:21:57 (local)
2004-Jan-17 14:21:57 (UTC)
User:rse
Branch:
Comment: Recognize special "Nil UUID" on decoding in uuid_dump().
Tickets:
Inspections:
Files:
ossp-pkg/uuid/ChangeLog      1.23 -> 1.24     5 inserted, 0 deleted
ossp-pkg/uuid/uuid.c      1.32 -> 1.33     9 inserted, 0 deleted

ossp-pkg/uuid/ChangeLog 1.23 -> 1.24

--- ChangeLog    2004/01/16 15:55:13     1.23
+++ ChangeLog    2004/01/17 14:21:57     1.24
@@ -11,6 +11,11 @@
   This is a list of all changes to OSSP uuid.
   For a more brief summary please have a look at the NEWS file.
 
+  Changes between 0.9.3 and 0.9.4 (16-Jan-2004 to xx-Jan-2004)
+
+   o Recognize special "Nil UUID" on decoding in uuid_dump().
+     [Ralf S. Engelschall]
+
   Changes between 0.9.2 and 0.9.3 (15-Jan-2004 to 16-Jan-2004)
 
    o Tested OSSP uuid on 16 particular Unix platforms and list


ossp-pkg/uuid/uuid.c 1.32 -> 1.33

--- uuid.c       2004/01/16 12:20:45     1.32
+++ uuid.c       2004/01/17 14:21:57     1.33
@@ -781,6 +781,7 @@
     time_t t_sec;
     char buf[19+1]; /* YYYY-MM-DD HH:MM:SS */
     struct tm *tm;
+    int r;
 
     /* sanity check argument(s) */
     if (uuid == NULL || str == NULL)
@@ -794,6 +795,14 @@
     uuid_format(uuid, &s);
     str_rsprintf(str, "UUID:    %s\n", s);
 
+    /* short-circuit special case of 'nil UUID' */
+    if (uuid_isnil(uuid, &r), r) {
+        str_rsprintf(str, "variant: [none]\n"
+                          "version: [none]\n"
+                          "content: Nil UUID\n");
+        return UUID_RC_OK;
+    }
+
     /* decode UUID variant */
     variant = "unknown";
     tmp8 = uuid->obj.clock_seq_hi_and_reserved;

CVSTrac 2.0.1