Fossil SCM
Rid the code of the legacy UUID_SIZE macro. Replace it everywhere with either HNAME_MAX or HNAME_LEN_SHA1 or HNAME_LEN_K256, as appropriate.
Commit
323299cb5605ed79ea3d13a64800ff22ac1ec4613e7048c7ba7d98920f7c4fb9
Parent
61941baf12257f9…
7 files changed
+1
-1
+3
-4
-10
+2
-2
+1
-1
+4
-5
+4
-4
+1
-1
| --- src/graph.c | ||
| +++ src/graph.c | ||
| @@ -37,11 +37,11 @@ | ||
| 37 | 37 | int rid; /* The rid for the check-in */ |
| 38 | 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | 39 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 40 | 40 | char *zBranch; /* Branch name */ |
| 41 | 41 | char *zBgClr; /* Background Color */ |
| 42 | - char zUuid[41]; /* Check-in for file ID */ | |
| 42 | + char zUuid[HNAME_MAX+1]; /* Check-in for file ID */ | |
| 43 | 43 | |
| 44 | 44 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 45 | 45 | GraphRow *pPrev; /* Previous row */ |
| 46 | 46 | |
| 47 | 47 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| 48 | 48 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -37,11 +37,11 @@ | |
| 37 | int rid; /* The rid for the check-in */ |
| 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 40 | char *zBranch; /* Branch name */ |
| 41 | char *zBgClr; /* Background Color */ |
| 42 | char zUuid[41]; /* Check-in for file ID */ |
| 43 | |
| 44 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 45 | GraphRow *pPrev; /* Previous row */ |
| 46 | |
| 47 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| 48 |
| --- src/graph.c | |
| +++ src/graph.c | |
| @@ -37,11 +37,11 @@ | |
| 37 | int rid; /* The rid for the check-in */ |
| 38 | i8 nParent; /* Number of parents. -1 for technote lines */ |
| 39 | int *aParent; /* Array of parents. 0 element is primary .*/ |
| 40 | char *zBranch; /* Branch name */ |
| 41 | char *zBgClr; /* Background Color */ |
| 42 | char zUuid[HNAME_MAX+1]; /* Check-in for file ID */ |
| 43 | |
| 44 | GraphRow *pNext; /* Next row down in the list of all rows */ |
| 45 | GraphRow *pPrev; /* Previous row */ |
| 46 | |
| 47 | int idx; /* Row index. First is 1. 0 used for "none" */ |
| 48 |
+3
-4
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1464,11 +1464,10 @@ | ||
| 1464 | 1464 | " ORDER BY mtime DESC /*sort*/", |
| 1465 | 1465 | rid |
| 1466 | 1466 | ); |
| 1467 | 1467 | while( db_step(&q)==SQLITE_ROW ){ |
| 1468 | 1468 | const char *zTarget = db_column_text(&q, 0); |
| 1469 | - int nTarget = db_column_bytes(&q, 0); | |
| 1470 | 1469 | const char *zFilename = db_column_text(&q, 1); |
| 1471 | 1470 | const char *zDate = db_column_text(&q, 2); |
| 1472 | 1471 | const char *zUser = db_column_text(&q, 3); |
| 1473 | 1472 | /* const char *zSrc = db_column_text(&q, 4); */ |
| 1474 | 1473 | if( cnt>0 ){ |
| @@ -1475,11 +1474,11 @@ | ||
| 1475 | 1474 | @ Also attachment "%h(zFilename)" to |
| 1476 | 1475 | }else{ |
| 1477 | 1476 | @ Attachment "%h(zFilename)" to |
| 1478 | 1477 | } |
| 1479 | 1478 | objType |= OBJTYPE_ATTACHMENT; |
| 1480 | - if( nTarget==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ | |
| 1479 | + if( fossil_is_uuid(zTarget) ){ | |
| 1481 | 1480 | if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", |
| 1482 | 1481 | zTarget) |
| 1483 | 1482 | ){ |
| 1484 | 1483 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1485 | 1484 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| @@ -2185,11 +2184,11 @@ | ||
| 2185 | 2184 | */ |
| 2186 | 2185 | void tinfo_page(void){ |
| 2187 | 2186 | int rid; |
| 2188 | 2187 | char *zDate; |
| 2189 | 2188 | const char *zUuid; |
| 2190 | - char zTktName[UUID_SIZE+1]; | |
| 2189 | + char zTktName[HNAME_MAX+1]; | |
| 2191 | 2190 | Manifest *pTktChng; |
| 2192 | 2191 | int modPending; |
| 2193 | 2192 | const char *zModAction; |
| 2194 | 2193 | char *zTktTitle; |
| 2195 | 2194 | login_check_credentials(); |
| @@ -2206,11 +2205,11 @@ | ||
| 2206 | 2205 | } |
| 2207 | 2206 | } |
| 2208 | 2207 | pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); |
| 2209 | 2208 | if( pTktChng==0 ) fossil_redirect_home(); |
| 2210 | 2209 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 2211 | - memcpy(zTktName, pTktChng->zTicketUuid, UUID_SIZE+1); | |
| 2210 | + sqlite3_snprintf(sizeof(zTktName), zTktName, "%s", pTktChng->zTicketUuid); | |
| 2212 | 2211 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 2213 | 2212 | if( strcmp(zModAction,"delete")==0 ){ |
| 2214 | 2213 | moderation_disapprove(rid); |
| 2215 | 2214 | /* |
| 2216 | 2215 | ** Next, check if the ticket still exists; if not, we cannot |
| 2217 | 2216 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1464,11 +1464,10 @@ | |
| 1464 | " ORDER BY mtime DESC /*sort*/", |
| 1465 | rid |
| 1466 | ); |
| 1467 | while( db_step(&q)==SQLITE_ROW ){ |
| 1468 | const char *zTarget = db_column_text(&q, 0); |
| 1469 | int nTarget = db_column_bytes(&q, 0); |
| 1470 | const char *zFilename = db_column_text(&q, 1); |
| 1471 | const char *zDate = db_column_text(&q, 2); |
| 1472 | const char *zUser = db_column_text(&q, 3); |
| 1473 | /* const char *zSrc = db_column_text(&q, 4); */ |
| 1474 | if( cnt>0 ){ |
| @@ -1475,11 +1474,11 @@ | |
| 1475 | @ Also attachment "%h(zFilename)" to |
| 1476 | }else{ |
| 1477 | @ Attachment "%h(zFilename)" to |
| 1478 | } |
| 1479 | objType |= OBJTYPE_ATTACHMENT; |
| 1480 | if( nTarget==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| 1481 | if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", |
| 1482 | zTarget) |
| 1483 | ){ |
| 1484 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1485 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| @@ -2185,11 +2184,11 @@ | |
| 2185 | */ |
| 2186 | void tinfo_page(void){ |
| 2187 | int rid; |
| 2188 | char *zDate; |
| 2189 | const char *zUuid; |
| 2190 | char zTktName[UUID_SIZE+1]; |
| 2191 | Manifest *pTktChng; |
| 2192 | int modPending; |
| 2193 | const char *zModAction; |
| 2194 | char *zTktTitle; |
| 2195 | login_check_credentials(); |
| @@ -2206,11 +2205,11 @@ | |
| 2206 | } |
| 2207 | } |
| 2208 | pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); |
| 2209 | if( pTktChng==0 ) fossil_redirect_home(); |
| 2210 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 2211 | memcpy(zTktName, pTktChng->zTicketUuid, UUID_SIZE+1); |
| 2212 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 2213 | if( strcmp(zModAction,"delete")==0 ){ |
| 2214 | moderation_disapprove(rid); |
| 2215 | /* |
| 2216 | ** Next, check if the ticket still exists; if not, we cannot |
| 2217 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1464,11 +1464,10 @@ | |
| 1464 | " ORDER BY mtime DESC /*sort*/", |
| 1465 | rid |
| 1466 | ); |
| 1467 | while( db_step(&q)==SQLITE_ROW ){ |
| 1468 | const char *zTarget = db_column_text(&q, 0); |
| 1469 | const char *zFilename = db_column_text(&q, 1); |
| 1470 | const char *zDate = db_column_text(&q, 2); |
| 1471 | const char *zUser = db_column_text(&q, 3); |
| 1472 | /* const char *zSrc = db_column_text(&q, 4); */ |
| 1473 | if( cnt>0 ){ |
| @@ -1475,11 +1474,11 @@ | |
| 1474 | @ Also attachment "%h(zFilename)" to |
| 1475 | }else{ |
| 1476 | @ Attachment "%h(zFilename)" to |
| 1477 | } |
| 1478 | objType |= OBJTYPE_ATTACHMENT; |
| 1479 | if( fossil_is_uuid(zTarget) ){ |
| 1480 | if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", |
| 1481 | zTarget) |
| 1482 | ){ |
| 1483 | if( g.perm.Hyperlink && g.anon.RdTkt ){ |
| 1484 | @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>] |
| @@ -2185,11 +2184,11 @@ | |
| 2184 | */ |
| 2185 | void tinfo_page(void){ |
| 2186 | int rid; |
| 2187 | char *zDate; |
| 2188 | const char *zUuid; |
| 2189 | char zTktName[HNAME_MAX+1]; |
| 2190 | Manifest *pTktChng; |
| 2191 | int modPending; |
| 2192 | const char *zModAction; |
| 2193 | char *zTktTitle; |
| 2194 | login_check_credentials(); |
| @@ -2206,11 +2205,11 @@ | |
| 2205 | } |
| 2206 | } |
| 2207 | pTktChng = manifest_get(rid, CFTYPE_TICKET, 0); |
| 2208 | if( pTktChng==0 ) fossil_redirect_home(); |
| 2209 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 2210 | sqlite3_snprintf(sizeof(zTktName), zTktName, "%s", pTktChng->zTicketUuid); |
| 2211 | if( g.perm.ModTkt && (zModAction = P("modaction"))!=0 ){ |
| 2212 | if( strcmp(zModAction,"delete")==0 ){ |
| 2213 | moderation_disapprove(rid); |
| 2214 | /* |
| 2215 | ** Next, check if the ticket still exists; if not, we cannot |
| 2216 |
-10
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -49,20 +49,10 @@ | ||
| 49 | 49 | #ifdef FOSSIL_ENABLE_JSON |
| 50 | 50 | # include "cson_amalgamation.h" /* JSON API. */ |
| 51 | 51 | # include "json_detail.h" |
| 52 | 52 | #endif |
| 53 | 53 | |
| 54 | -/* | |
| 55 | -** Size of a UUID in characters. A UUID is a randomly generated | |
| 56 | -** lower-case hexadecimal number used to identify tickets. | |
| 57 | -** | |
| 58 | -** In Fossil 1.x, UUID also referred to a SHA1 artifact hash. But that | |
| 59 | -** usage is now obsolete. The term UUID should now mean only a very large | |
| 60 | -** random number used as a unique identifier for tickets or other objects. | |
| 61 | -*/ | |
| 62 | -#define UUID_SIZE 40 | |
| 63 | - | |
| 64 | 54 | /* |
| 65 | 55 | ** Maximum number of auxiliary parameters on reports |
| 66 | 56 | */ |
| 67 | 57 | #define MX_AUX 5 |
| 68 | 58 | |
| 69 | 59 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -49,20 +49,10 @@ | |
| 49 | #ifdef FOSSIL_ENABLE_JSON |
| 50 | # include "cson_amalgamation.h" /* JSON API. */ |
| 51 | # include "json_detail.h" |
| 52 | #endif |
| 53 | |
| 54 | /* |
| 55 | ** Size of a UUID in characters. A UUID is a randomly generated |
| 56 | ** lower-case hexadecimal number used to identify tickets. |
| 57 | ** |
| 58 | ** In Fossil 1.x, UUID also referred to a SHA1 artifact hash. But that |
| 59 | ** usage is now obsolete. The term UUID should now mean only a very large |
| 60 | ** random number used as a unique identifier for tickets or other objects. |
| 61 | */ |
| 62 | #define UUID_SIZE 40 |
| 63 | |
| 64 | /* |
| 65 | ** Maximum number of auxiliary parameters on reports |
| 66 | */ |
| 67 | #define MX_AUX 5 |
| 68 | |
| 69 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -49,20 +49,10 @@ | |
| 49 | #ifdef FOSSIL_ENABLE_JSON |
| 50 | # include "cson_amalgamation.h" /* JSON API. */ |
| 51 | # include "json_detail.h" |
| 52 | #endif |
| 53 | |
| 54 | /* |
| 55 | ** Maximum number of auxiliary parameters on reports |
| 56 | */ |
| 57 | #define MX_AUX 5 |
| 58 | |
| 59 |
+2
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -607,12 +607,12 @@ | ||
| 607 | 607 | ** is amending. |
| 608 | 608 | */ |
| 609 | 609 | case 'K': { |
| 610 | 610 | if( p->zTicketUuid!=0 ) SYNTAX("more than one K-card"); |
| 611 | 611 | p->zTicketUuid = next_token(&x, &sz); |
| 612 | - if( sz!=UUID_SIZE ) SYNTAX("K-card UUID is the wrong size"); | |
| 613 | - if( !validate16(p->zTicketUuid, UUID_SIZE) ){ | |
| 612 | + if( sz!=HNAME_LEN_SHA1 ) SYNTAX("K-card UUID is the wrong size"); | |
| 613 | + if( !validate16(p->zTicketUuid, sz) ){ | |
| 614 | 614 | SYNTAX("invalid K-card UUID"); |
| 615 | 615 | } |
| 616 | 616 | break; |
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -607,12 +607,12 @@ | |
| 607 | ** is amending. |
| 608 | */ |
| 609 | case 'K': { |
| 610 | if( p->zTicketUuid!=0 ) SYNTAX("more than one K-card"); |
| 611 | p->zTicketUuid = next_token(&x, &sz); |
| 612 | if( sz!=UUID_SIZE ) SYNTAX("K-card UUID is the wrong size"); |
| 613 | if( !validate16(p->zTicketUuid, UUID_SIZE) ){ |
| 614 | SYNTAX("invalid K-card UUID"); |
| 615 | } |
| 616 | break; |
| 617 | } |
| 618 | |
| 619 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -607,12 +607,12 @@ | |
| 607 | ** is amending. |
| 608 | */ |
| 609 | case 'K': { |
| 610 | if( p->zTicketUuid!=0 ) SYNTAX("more than one K-card"); |
| 611 | p->zTicketUuid = next_token(&x, &sz); |
| 612 | if( sz!=HNAME_LEN_SHA1 ) SYNTAX("K-card UUID is the wrong size"); |
| 613 | if( !validate16(p->zTicketUuid, sz) ){ |
| 614 | SYNTAX("invalid K-card UUID"); |
| 615 | } |
| 616 | break; |
| 617 | } |
| 618 | |
| 619 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -747,11 +747,11 @@ | ||
| 747 | 747 | zName = P("name"); |
| 748 | 748 | if( P("cancel") ){ |
| 749 | 749 | cgi_redirectf("tktview?name=%T", zName); |
| 750 | 750 | } |
| 751 | 751 | style_header("Edit Ticket"); |
| 752 | - if( zName==0 || (nName = strlen(zName))<4 || nName>UUID_SIZE | |
| 752 | + if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1 | |
| 753 | 753 | || !validate16(zName,nName) ){ |
| 754 | 754 | @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span> |
| 755 | 755 | style_footer(); |
| 756 | 756 | return; |
| 757 | 757 | } |
| 758 | 758 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -747,11 +747,11 @@ | |
| 747 | zName = P("name"); |
| 748 | if( P("cancel") ){ |
| 749 | cgi_redirectf("tktview?name=%T", zName); |
| 750 | } |
| 751 | style_header("Edit Ticket"); |
| 752 | if( zName==0 || (nName = strlen(zName))<4 || nName>UUID_SIZE |
| 753 | || !validate16(zName,nName) ){ |
| 754 | @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span> |
| 755 | style_footer(); |
| 756 | return; |
| 757 | } |
| 758 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -747,11 +747,11 @@ | |
| 747 | zName = P("name"); |
| 748 | if( P("cancel") ){ |
| 749 | cgi_redirectf("tktview?name=%T", zName); |
| 750 | } |
| 751 | style_header("Edit Ticket"); |
| 752 | if( zName==0 || (nName = strlen(zName))<4 || nName>HNAME_LEN_SHA1 |
| 753 | || !validate16(zName,nName) ){ |
| 754 | @ <span class="tktError">Not a valid ticket id: "%h(zName)"</span> |
| 755 | style_footer(); |
| 756 | return; |
| 757 | } |
| 758 |
+4
-5
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -376,17 +376,16 @@ | ||
| 376 | 376 | return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF; |
| 377 | 377 | #endif |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /* |
| 381 | -** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains | |
| 382 | -** only lower-case ASCII hexadecimal values. | |
| 381 | +** Returns TRUE if zSym is exactly HNAME_LEN_SHA1 or HNAME_LEN_K256 | |
| 382 | +** bytes long and contains only lower-case ASCII hexadecimal values. | |
| 383 | 383 | */ |
| 384 | 384 | int fossil_is_uuid(const char *zSym){ |
| 385 | - return zSym | |
| 386 | - && (UUID_SIZE==strlen(zSym)) | |
| 387 | - && validate16(zSym, UUID_SIZE); | |
| 385 | + int sz = zSym ? (int)strlen(zSym) : 0; | |
| 386 | + return (HNAME_LEN_SHA1==sz || HNAME_LEN_K256==sz) && validate16(zSym, sz); | |
| 388 | 387 | } |
| 389 | 388 | |
| 390 | 389 | /* |
| 391 | 390 | ** Return true if the input string is NULL or all whitespace. |
| 392 | 391 | ** Return false if the input string contains text. |
| 393 | 392 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -376,17 +376,16 @@ | |
| 376 | return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF; |
| 377 | #endif |
| 378 | } |
| 379 | |
| 380 | /* |
| 381 | ** Returns TRUE if zSym is exactly UUID_SIZE bytes long and contains |
| 382 | ** only lower-case ASCII hexadecimal values. |
| 383 | */ |
| 384 | int fossil_is_uuid(const char *zSym){ |
| 385 | return zSym |
| 386 | && (UUID_SIZE==strlen(zSym)) |
| 387 | && validate16(zSym, UUID_SIZE); |
| 388 | } |
| 389 | |
| 390 | /* |
| 391 | ** Return true if the input string is NULL or all whitespace. |
| 392 | ** Return false if the input string contains text. |
| 393 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -376,17 +376,16 @@ | |
| 376 | return fcntl(fd, F_GETFL)!=(-1) || errno!=EBADF; |
| 377 | #endif |
| 378 | } |
| 379 | |
| 380 | /* |
| 381 | ** Returns TRUE if zSym is exactly HNAME_LEN_SHA1 or HNAME_LEN_K256 |
| 382 | ** bytes long and contains only lower-case ASCII hexadecimal values. |
| 383 | */ |
| 384 | int fossil_is_uuid(const char *zSym){ |
| 385 | int sz = zSym ? (int)strlen(zSym) : 0; |
| 386 | return (HNAME_LEN_SHA1==sz || HNAME_LEN_K256==sz) && validate16(zSym, sz); |
| 387 | } |
| 388 | |
| 389 | /* |
| 390 | ** Return true if the input string is NULL or all whitespace. |
| 391 | ** Return false if the input string contains text. |
| 392 |
+4
-4
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1110,12 +1110,12 @@ | ||
| 1110 | 1110 | ){ |
| 1111 | 1111 | static Stmt q; |
| 1112 | 1112 | static int once = 1; |
| 1113 | 1113 | int n; |
| 1114 | 1114 | int rc; |
| 1115 | - char zLower[UUID_SIZE+1]; | |
| 1116 | - char zUpper[UUID_SIZE+1]; | |
| 1115 | + char zLower[HNAME_MAX+1]; | |
| 1116 | + char zUpper[HNAME_MAX+1]; | |
| 1117 | 1117 | n = strlen(zTarget); |
| 1118 | 1118 | memcpy(zLower, zTarget, n+1); |
| 1119 | 1119 | canonical16(zLower, n+1); |
| 1120 | 1120 | memcpy(zUpper, zLower, n+1); |
| 1121 | 1121 | zUpper[n-1]++; |
| @@ -1218,11 +1218,11 @@ | ||
| 1218 | 1218 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1219 | 1219 | }else if( zTarget[0]=='#' ){ |
| 1220 | 1220 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1221 | 1221 | }else if( is_valid_hname(zTarget) ){ |
| 1222 | 1222 | int isClosed = 0; |
| 1223 | - if( strlen(zTarget)<=UUID_SIZE && is_ticket(zTarget, &isClosed) ){ | |
| 1223 | + if( strlen(zTarget)<=HNAME_MAX && is_ticket(zTarget, &isClosed) ){ | |
| 1224 | 1224 | /* Special display processing for tickets. Display the hyperlink |
| 1225 | 1225 | ** as crossed out if the ticket is closed. |
| 1226 | 1226 | */ |
| 1227 | 1227 | if( isClosed ){ |
| 1228 | 1228 | if( g.perm.Hyperlink ){ |
| @@ -1831,11 +1831,11 @@ | ||
| 1831 | 1831 | } |
| 1832 | 1832 | switch( tokenType ){ |
| 1833 | 1833 | case TOKEN_LINK: { |
| 1834 | 1834 | char *zTarget; |
| 1835 | 1835 | int i, c; |
| 1836 | - char zLink[42]; | |
| 1836 | + char zLink[HNAME_MAX+4]; | |
| 1837 | 1837 | |
| 1838 | 1838 | zTarget = &z[1]; |
| 1839 | 1839 | for(i=0; zTarget[i] && zTarget[i]!='|' && zTarget[i]!=']'; i++){} |
| 1840 | 1840 | while(i>1 && zTarget[i-1]==' '){ i--; } |
| 1841 | 1841 | c = zTarget[i]; |
| 1842 | 1842 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1110,12 +1110,12 @@ | |
| 1110 | ){ |
| 1111 | static Stmt q; |
| 1112 | static int once = 1; |
| 1113 | int n; |
| 1114 | int rc; |
| 1115 | char zLower[UUID_SIZE+1]; |
| 1116 | char zUpper[UUID_SIZE+1]; |
| 1117 | n = strlen(zTarget); |
| 1118 | memcpy(zLower, zTarget, n+1); |
| 1119 | canonical16(zLower, n+1); |
| 1120 | memcpy(zUpper, zLower, n+1); |
| 1121 | zUpper[n-1]++; |
| @@ -1218,11 +1218,11 @@ | |
| 1218 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1219 | }else if( zTarget[0]=='#' ){ |
| 1220 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1221 | }else if( is_valid_hname(zTarget) ){ |
| 1222 | int isClosed = 0; |
| 1223 | if( strlen(zTarget)<=UUID_SIZE && is_ticket(zTarget, &isClosed) ){ |
| 1224 | /* Special display processing for tickets. Display the hyperlink |
| 1225 | ** as crossed out if the ticket is closed. |
| 1226 | */ |
| 1227 | if( isClosed ){ |
| 1228 | if( g.perm.Hyperlink ){ |
| @@ -1831,11 +1831,11 @@ | |
| 1831 | } |
| 1832 | switch( tokenType ){ |
| 1833 | case TOKEN_LINK: { |
| 1834 | char *zTarget; |
| 1835 | int i, c; |
| 1836 | char zLink[42]; |
| 1837 | |
| 1838 | zTarget = &z[1]; |
| 1839 | for(i=0; zTarget[i] && zTarget[i]!='|' && zTarget[i]!=']'; i++){} |
| 1840 | while(i>1 && zTarget[i-1]==' '){ i--; } |
| 1841 | c = zTarget[i]; |
| 1842 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1110,12 +1110,12 @@ | |
| 1110 | ){ |
| 1111 | static Stmt q; |
| 1112 | static int once = 1; |
| 1113 | int n; |
| 1114 | int rc; |
| 1115 | char zLower[HNAME_MAX+1]; |
| 1116 | char zUpper[HNAME_MAX+1]; |
| 1117 | n = strlen(zTarget); |
| 1118 | memcpy(zLower, zTarget, n+1); |
| 1119 | canonical16(zLower, n+1); |
| 1120 | memcpy(zUpper, zLower, n+1); |
| 1121 | zUpper[n-1]++; |
| @@ -1218,11 +1218,11 @@ | |
| 1218 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1219 | }else if( zTarget[0]=='#' ){ |
| 1220 | blob_appendf(p->pOut, "<a href=\"%h\">", zTarget); |
| 1221 | }else if( is_valid_hname(zTarget) ){ |
| 1222 | int isClosed = 0; |
| 1223 | if( strlen(zTarget)<=HNAME_MAX && is_ticket(zTarget, &isClosed) ){ |
| 1224 | /* Special display processing for tickets. Display the hyperlink |
| 1225 | ** as crossed out if the ticket is closed. |
| 1226 | */ |
| 1227 | if( isClosed ){ |
| 1228 | if( g.perm.Hyperlink ){ |
| @@ -1831,11 +1831,11 @@ | |
| 1831 | } |
| 1832 | switch( tokenType ){ |
| 1833 | case TOKEN_LINK: { |
| 1834 | char *zTarget; |
| 1835 | int i, c; |
| 1836 | char zLink[HNAME_MAX+4]; |
| 1837 | |
| 1838 | zTarget = &z[1]; |
| 1839 | for(i=0; zTarget[i] && zTarget[i]!='|' && zTarget[i]!=']'; i++){} |
| 1840 | while(i>1 && zTarget[i-1]==' '){ i--; } |
| 1841 | c = zTarget[i]; |
| 1842 |