Fossil

Check-in [734d429940]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use the same algorithm for event-id's for UUID's as in other UI locations: Make sure that the UUID contains at least a single lower-case hex digit, with a minimum of length 10.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | 16-digit-event-ids
Files: files | file ages | folders
SHA1: 734d4299401357a56768106350c6b766a1441524
User & Date: jan.nijtmans 2014-06-30 09:13:28.451
Original Comment: Use the same algorithm for event-id's for UUID's as in other UI locations: Make sure that the UUID contains at least a single lower-case digit, with a minimum of length 10.
Context
2014-06-30
19:07
Coding style adjustments. Remark (nijtmans): This commit contains more than just a coding style adjustment, changes the output of UUID's different than the proposed algorithm; if longer than 10 characters, the final non-digit char is missing. Demonstration: [/timeline?n=20&y=e]. Look at the last UUID in the timeline , it is [347871278941] but it should have been [347871278941b]! check-in: b6f137a01e user: mistachkin tags: 16-digit-event-ids
09:13
Use the same algorithm for event-id's for UUID's as in other UI locations: Make sure that the UUID contains at least a single lower-case hex digit, with a minimum of length 10. check-in: 734d429940 user: jan.nijtmans tags: 16-digit-event-ids
2014-06-27
23:19
Fix a possible NULL pointer dereference in the "fusefs" implementation. check-in: 2e51be8ec2 user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/printf.c.
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624




625
626
627
628
629
630
631
        break;
      }
      case etROOT: {
        bufpt = g.zTop ? g.zTop : "";
        length = (int)strlen(bufpt);
        break;
      }
      case etSTRINGID: {
        precision = 16;
        /* Fall through */
      }
      case etSTRING:
      case etDYNSTRING: {
        int limit = flag_alternateform ? va_arg(ap,int) : -1;
        bufpt = va_arg(ap,char*);
        if( bufpt==0 ){
          bufpt = "";
        }else if( xtype==etDYNSTRING ){
          zExtra = bufpt;




        }
        length = StrNLen32(bufpt, limit);
        if( precision>=0 && precision<length ) length = precision;
        break;
      }
      case etBLOB: {
        int limit = flag_alternateform ? va_arg(ap, int) : -1;







|
<
<
<








>
>
>
>







606
607
608
609
610
611
612
613



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
        break;
      }
      case etROOT: {
        bufpt = g.zTop ? g.zTop : "";
        length = (int)strlen(bufpt);
        break;
      }
      case etSTRINGID:



      case etSTRING:
      case etDYNSTRING: {
        int limit = flag_alternateform ? va_arg(ap,int) : -1;
        bufpt = va_arg(ap,char*);
        if( bufpt==0 ){
          bufpt = "";
        }else if( xtype==etDYNSTRING ){
          zExtra = bufpt;
        }else if( xtype==etSTRINGID ){
          precision = 0;
          while( fossil_isdigit(bufpt[precision++]) ){};
          if( precision<10 ) precision=10;
        }
        length = StrNLen32(bufpt, limit);
        if( precision>=0 && precision<length ) length = precision;
        break;
      }
      case etBLOB: {
        int limit = flag_alternateform ? va_arg(ap, int) : -1;
Changes to src/timeline.c.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
** This file contains code to implement the timeline web page
**
*/
#include "config.h"
#include <string.h>
#include <time.h>
#include "timeline.h"

/*
** Shorten a UUID so that is the minimum length needed to contain
** at least one digit in the range 'a'..'f'.  The minimum length is 10.
*/
static void shorten_uuid(char *zDest, const char *zSrc){
  int i;
  for(i=0; i<10 && zSrc[i]<='9'; i++){}
  memcpy(zDest, zSrc, 10);
  if( i==10 && zSrc[i] ){
    do{
      zDest[i] = zSrc[i];
      i++;
    }while( zSrc[i-1]<='9' );
  }else{
    i = 10;
  }
  zDest[i] = 0;
}


/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){
  char z[UUID_SIZE+1];
  shorten_uuid(z, zUuid);
  if( g.perm.Hyperlink ){
    @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%s(z)]</a>
  }else{
    @ <span class="timelineHistDsp">[%s(z)]</span>
  }
}

/*
** Generate a hyperlink to a date & time.
*/
void hyperlink_to_date(const char *zDate, const char *zSuffix){







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<





<
<

|

|







18
19
20
21
22
23
24




















25
26
27
28
29


30
31
32
33
34
35
36
37
38
39
40
** This file contains code to implement the timeline web page
**
*/
#include "config.h"
#include <string.h>
#include <time.h>
#include "timeline.h"





















/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){


  if( g.perm.Hyperlink ){
    @ %z(xhref("class='timelineHistLink'","%R/info/%s",zUuid))[%S(zUuid)]</a>
  }else{
    @ <span class="timelineHistDsp">[%S(zUuid)]</span>
  }
}

/*
** Generate a hyperlink to a date & time.
*/
void hyperlink_to_date(const char *zDate, const char *zSuffix){