Fossil SCM
merge trunk
Commit
e9f38ae8abfa33dae507bdb00c966d3bdab35562
Parent
b5e2e50040aadec…
16 files changed
+2
-2
+2
-2
+3
-3
+79
-22
+2
-2
+1
-1
+17
-8
+12
-12
+12
-12
+4
-4
+4
-4
+1
-1
+1
-1
+17
-8
+10
-10
+10
-10
+2
-2
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -355,11 +355,11 @@ | ||
| 355 | 355 | cnt++; |
| 356 | 356 | } |
| 357 | 357 | if( colorTest ){ |
| 358 | 358 | const char *zColor = hash_color(zBr); |
| 359 | 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | - @ %h(zBr) → %s(zColor)</span></li> | |
| 360 | + @ %h(zBr) → %s(zColor)</span></li> | |
| 361 | 361 | }else{ |
| 362 | 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | if( cnt ){ |
| 366 | 366 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -355,11 +355,11 @@ | |
| 355 | cnt++; |
| 356 | } |
| 357 | if( colorTest ){ |
| 358 | const char *zColor = hash_color(zBr); |
| 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | @ %h(zBr) → %s(zColor)</span></li> |
| 361 | }else{ |
| 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | } |
| 364 | } |
| 365 | if( cnt ){ |
| 366 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -355,11 +355,11 @@ | |
| 355 | cnt++; |
| 356 | } |
| 357 | if( colorTest ){ |
| 358 | const char *zColor = hash_color(zBr); |
| 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | @ %h(zBr) → %s(zColor)</span></li> |
| 361 | }else{ |
| 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | } |
| 364 | } |
| 365 | if( cnt ){ |
| 366 |
+2
-2
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -355,11 +355,11 @@ | ||
| 355 | 355 | cnt++; |
| 356 | 356 | } |
| 357 | 357 | if( colorTest ){ |
| 358 | 358 | const char *zColor = hash_color(zBr); |
| 359 | 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | - @ %h(zBr) → %s(zColor)</span></li> | |
| 360 | + @ %h(zBr) → %s(zColor)</span></li> | |
| 361 | 361 | }else{ |
| 362 | 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | 363 | } |
| 364 | 364 | } |
| 365 | 365 | if( cnt ){ |
| 366 | 366 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -355,11 +355,11 @@ | |
| 355 | cnt++; |
| 356 | } |
| 357 | if( colorTest ){ |
| 358 | const char *zColor = hash_color(zBr); |
| 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | @ %h(zBr) → %s(zColor)</span></li> |
| 361 | }else{ |
| 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | } |
| 364 | } |
| 365 | if( cnt ){ |
| 366 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -355,11 +355,11 @@ | |
| 355 | cnt++; |
| 356 | } |
| 357 | if( colorTest ){ |
| 358 | const char *zColor = hash_color(zBr); |
| 359 | @ <li><span style="background-color: %s(zColor)"> |
| 360 | @ %h(zBr) → %s(zColor)</span></li> |
| 361 | }else{ |
| 362 | @ <li>%z(href("%R/timeline?r=%T",zBr))%h(zBr)</a></li> |
| 363 | } |
| 364 | } |
| 365 | if( cnt ){ |
| 366 |
+3
-3
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2010 D. Richard Hipp | |
| 2 | +** Copyright © 2010 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -136,11 +136,11 @@ | ||
| 136 | 136 | if( markfile_in!=0 ){ |
| 137 | 137 | Stmt qb,qc; |
| 138 | 138 | char line[100]; |
| 139 | 139 | FILE *f; |
| 140 | 140 | |
| 141 | - f = fopen(markfile_in, "r"); | |
| 141 | + f = fossil_fopen(markfile_in, "r"); | |
| 142 | 142 | if( f==0 ){ |
| 143 | 143 | fossil_panic("cannot open %s for reading", markfile_in); |
| 144 | 144 | } |
| 145 | 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| @@ -325,11 +325,11 @@ | ||
| 325 | 325 | db_finalize(&q); |
| 326 | 326 | bag_clear(&vers); |
| 327 | 327 | |
| 328 | 328 | if( markfile_out!=0 ){ |
| 329 | 329 | FILE *f; |
| 330 | - f = fopen(markfile_out, "w"); | |
| 330 | + f = fossil_fopen(markfile_out, "w"); | |
| 331 | 331 | if( f == 0 ){ |
| 332 | 332 | fossil_panic("cannot open %s for writing", markfile_out); |
| 333 | 333 | } |
| 334 | 334 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 335 | 335 | while( db_step(&q)==SQLITE_ROW ){ |
| 336 | 336 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2010 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -136,11 +136,11 @@ | |
| 136 | if( markfile_in!=0 ){ |
| 137 | Stmt qb,qc; |
| 138 | char line[100]; |
| 139 | FILE *f; |
| 140 | |
| 141 | f = fopen(markfile_in, "r"); |
| 142 | if( f==0 ){ |
| 143 | fossil_panic("cannot open %s for reading", markfile_in); |
| 144 | } |
| 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| @@ -325,11 +325,11 @@ | |
| 325 | db_finalize(&q); |
| 326 | bag_clear(&vers); |
| 327 | |
| 328 | if( markfile_out!=0 ){ |
| 329 | FILE *f; |
| 330 | f = fopen(markfile_out, "w"); |
| 331 | if( f == 0 ){ |
| 332 | fossil_panic("cannot open %s for writing", markfile_out); |
| 333 | } |
| 334 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 335 | while( db_step(&q)==SQLITE_ROW ){ |
| 336 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2010 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -136,11 +136,11 @@ | |
| 136 | if( markfile_in!=0 ){ |
| 137 | Stmt qb,qc; |
| 138 | char line[100]; |
| 139 | FILE *f; |
| 140 | |
| 141 | f = fossil_fopen(markfile_in, "r"); |
| 142 | if( f==0 ){ |
| 143 | fossil_panic("cannot open %s for reading", markfile_in); |
| 144 | } |
| 145 | db_prepare(&qb, "INSERT OR IGNORE INTO oldblob VALUES (:rid)"); |
| 146 | db_prepare(&qc, "INSERT OR IGNORE INTO oldcommit VALUES (:rid)"); |
| @@ -325,11 +325,11 @@ | |
| 325 | db_finalize(&q); |
| 326 | bag_clear(&vers); |
| 327 | |
| 328 | if( markfile_out!=0 ){ |
| 329 | FILE *f; |
| 330 | f = fossil_fopen(markfile_out, "w"); |
| 331 | if( f == 0 ){ |
| 332 | fossil_panic("cannot open %s for writing", markfile_out); |
| 333 | } |
| 334 | db_prepare(&q, "SELECT rid FROM oldblob"); |
| 335 | while( db_step(&q)==SQLITE_ROW ){ |
| 336 |
+79
-22
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2006 D. Richard Hipp | |
| 2 | +** Copyright © 2006 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -32,10 +32,11 @@ | ||
| 32 | 32 | |
| 33 | 33 | /* |
| 34 | 34 | ** On Windows, include the Platform SDK header file. |
| 35 | 35 | */ |
| 36 | 36 | #ifdef _WIN32 |
| 37 | +# include <direct.h> | |
| 37 | 38 | # include <windows.h> |
| 38 | 39 | #endif |
| 39 | 40 | |
| 40 | 41 | /* |
| 41 | 42 | ** The file status information from the most recent stat() call. |
| @@ -68,12 +69,12 @@ | ||
| 68 | 69 | }else{ |
| 69 | 70 | return stat(zFilename, buf); |
| 70 | 71 | } |
| 71 | 72 | #else |
| 72 | 73 | int rc = 0; |
| 73 | - char *zMbcs = fossil_utf8_to_mbcs(zFilename); | |
| 74 | - rc = stat(zMbcs, buf); | |
| 74 | + wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); | |
| 75 | + rc = _wstati64(zMbcs, buf); | |
| 75 | 76 | fossil_mbcs_free(zMbcs); |
| 76 | 77 | return rc; |
| 77 | 78 | #endif |
| 78 | 79 | } |
| 79 | 80 | |
| @@ -298,13 +299,17 @@ | ||
| 298 | 299 | |
| 299 | 300 | /* |
| 300 | 301 | ** Wrapper around the access() system call. |
| 301 | 302 | */ |
| 302 | 303 | int file_access(const char *zFilename, int flags){ |
| 303 | - char *zMbcs = fossil_utf8_to_mbcs(zFilename); | |
| 304 | - int rc = access(zMbcs, flags); | |
| 304 | +#ifdef _WIN32 | |
| 305 | + wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); | |
| 306 | + int rc = _waccess(zMbcs, flags); | |
| 305 | 307 | fossil_mbcs_free(zMbcs); |
| 308 | +#else | |
| 309 | + int rc = access(zFilename, flags); | |
| 310 | +#endif | |
| 306 | 311 | return rc; |
| 307 | 312 | } |
| 308 | 313 | |
| 309 | 314 | /* |
| 310 | 315 | ** Find an unused filename similar to zBase with zSuffix appended. |
| @@ -389,13 +394,17 @@ | ||
| 389 | 394 | |
| 390 | 395 | /* |
| 391 | 396 | ** Delete a file. |
| 392 | 397 | */ |
| 393 | 398 | void file_delete(const char *zFilename){ |
| 394 | - char *z = fossil_utf8_to_mbcs(zFilename); | |
| 395 | - unlink(z); | |
| 399 | +#ifdef _WIN32 | |
| 400 | + wchar_t *z = fossil_utf8_to_unicode(zFilename); | |
| 401 | + _wunlink(z); | |
| 396 | 402 | fossil_mbcs_free(z); |
| 403 | +#else | |
| 404 | + unlink(zFilename); | |
| 405 | +#endif | |
| 397 | 406 | } |
| 398 | 407 | |
| 399 | 408 | /* |
| 400 | 409 | ** Create the directory named in the argument, if it does not already |
| 401 | 410 | ** exist. If forceFlag is 1, delete any prior non-directory object |
| @@ -410,12 +419,12 @@ | ||
| 410 | 419 | file_delete(zName); |
| 411 | 420 | } |
| 412 | 421 | if( rc!=1 ){ |
| 413 | 422 | #if defined(_WIN32) |
| 414 | 423 | int rc; |
| 415 | - char *zMbcs = fossil_utf8_to_mbcs(zName); | |
| 416 | - rc = mkdir(zMbcs); | |
| 424 | + wchar_t *zMbcs = fossil_utf8_to_unicode(zName); | |
| 425 | + rc = _wmkdir(zMbcs); | |
| 417 | 426 | fossil_mbcs_free(zMbcs); |
| 418 | 427 | return rc; |
| 419 | 428 | #else |
| 420 | 429 | return mkdir(zName, 0755); |
| 421 | 430 | #endif |
| @@ -561,24 +570,24 @@ | ||
| 561 | 570 | } |
| 562 | 571 | |
| 563 | 572 | /* |
| 564 | 573 | ** Get the current working directory. |
| 565 | 574 | ** |
| 566 | -** On windows, the name is converted from MBCS to UTF8 and all '\\' | |
| 575 | +** On windows, the name is converted from unicode to UTF8 and all '\\' | |
| 567 | 576 | ** characters are converted to '/'. No conversions are needed on |
| 568 | 577 | ** unix. |
| 569 | 578 | */ |
| 570 | 579 | void file_getcwd(char *zBuf, int nBuf){ |
| 571 | 580 | #ifdef _WIN32 |
| 572 | 581 | char *zPwdUtf8; |
| 573 | 582 | int nPwd; |
| 574 | 583 | int i; |
| 575 | - char zPwd[2000]; | |
| 576 | - if( getcwd(zPwd, sizeof(zPwd)-1)==0 ){ | |
| 584 | + wchar_t zPwd[2000]; | |
| 585 | + if( _wgetcwd(zPwd, sizeof(zPwd)-1)==0 ){ | |
| 577 | 586 | fossil_fatal("cannot find the current working directory."); |
| 578 | 587 | } |
| 579 | - zPwdUtf8 = fossil_mbcs_to_utf8(zPwd); | |
| 588 | + zPwdUtf8 = fossil_unicode_to_utf8(zPwd); | |
| 580 | 589 | nPwd = strlen(zPwdUtf8); |
| 581 | 590 | if( nPwd > nBuf-1 ){ |
| 582 | 591 | fossil_fatal("pwd too big: max %d\n", nBuf-1); |
| 583 | 592 | } |
| 584 | 593 | for(i=0; zPwdUtf8[i]; i++) if( zPwdUtf8[i]=='\\' ) zPwdUtf8[i] = '/'; |
| @@ -928,14 +937,14 @@ | ||
| 928 | 937 | unsigned int i, j; |
| 929 | 938 | const char *zDir = "."; |
| 930 | 939 | int cnt = 0; |
| 931 | 940 | |
| 932 | 941 | #if defined(_WIN32) |
| 933 | - char zTmpPath[MAX_PATH]; | |
| 942 | + wchar_t zTmpPath[MAX_PATH]; | |
| 934 | 943 | |
| 935 | - if( GetTempPath(sizeof(zTmpPath), zTmpPath) ){ | |
| 936 | - azDirs[0] = zTmpPath; | |
| 944 | + if( GetTempPathW(MAX_PATH, zTmpPath) ){ | |
| 945 | + azDirs[0] = fossil_unicode_to_utf8(zTmpPath); | |
| 937 | 946 | } |
| 938 | 947 | |
| 939 | 948 | azDirs[1] = fossil_getenv("TEMP"); |
| 940 | 949 | azDirs[2] = fossil_getenv("TMP"); |
| 941 | 950 | #endif |
| @@ -1014,10 +1023,29 @@ | ||
| 1014 | 1023 | return sqlite3_win32_mbcs_to_utf8(zMbcs); |
| 1015 | 1024 | #else |
| 1016 | 1025 | return (char*)zMbcs; /* No-op on unix */ |
| 1017 | 1026 | #endif |
| 1018 | 1027 | } |
| 1028 | + | |
| 1029 | +/* | |
| 1030 | +** Translate Unicode to UTF8. Return a pointer to the translated text. | |
| 1031 | +** Call fossil_mbcs_free() to deallocate any memory used to store the | |
| 1032 | +** returned pointer when done. | |
| 1033 | +*/ | |
| 1034 | +char *fossil_unicode_to_utf8(const void *zUnicode){ | |
| 1035 | +#ifdef _WIN32 | |
| 1036 | + int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0); | |
| 1037 | + char *zUtf = sqlite3_malloc( nByte ); | |
| 1038 | + if( zUtf==0 ){ | |
| 1039 | + return 0; | |
| 1040 | + } | |
| 1041 | + WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, zUtf, nByte, 0, 0); | |
| 1042 | + return zUtf; | |
| 1043 | +#else | |
| 1044 | + return (char *)zUnicode; /* No-op on unix */ | |
| 1045 | +#endif | |
| 1046 | +} | |
| 1019 | 1047 | |
| 1020 | 1048 | /* |
| 1021 | 1049 | ** Translate UTF8 to MBCS for use in system calls. Return a pointer to the |
| 1022 | 1050 | ** translated text.. Call fossil_mbcs_free() to deallocate any memory |
| 1023 | 1051 | ** used to store the returned pointer when done. |
| @@ -1028,18 +1056,41 @@ | ||
| 1028 | 1056 | return sqlite3_win32_utf8_to_mbcs(zUtf8); |
| 1029 | 1057 | #else |
| 1030 | 1058 | return (char*)zUtf8; /* No-op on unix */ |
| 1031 | 1059 | #endif |
| 1032 | 1060 | } |
| 1061 | + | |
| 1062 | +/* | |
| 1063 | +** Translate UTF8 to unicode for use in system calls. Return a pointer to the | |
| 1064 | +** translated text.. Call fossil_mbcs_free() to deallocate any memory | |
| 1065 | +** used to store the returned pointer when done. | |
| 1066 | +*/ | |
| 1067 | +void *fossil_utf8_to_unicode(const char *zUtf8){ | |
| 1068 | +#ifdef _WIN32 | |
| 1069 | + int nByte = MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, 0, 0); | |
| 1070 | + wchar_t *zUnicode = sqlite3_malloc( nByte * 2 ); | |
| 1071 | + if( zUnicode==0 ){ | |
| 1072 | + return 0; | |
| 1073 | + } | |
| 1074 | + MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, zUnicode, nByte); | |
| 1075 | + return zUnicode; | |
| 1076 | +#else | |
| 1077 | + return (void *)zUtf8; /* No-op on unix */ | |
| 1078 | +#endif | |
| 1079 | +} | |
| 1033 | 1080 | |
| 1034 | 1081 | /* |
| 1035 | 1082 | ** Return the value of an environment variable as UTF8. |
| 1036 | 1083 | */ |
| 1037 | 1084 | char *fossil_getenv(const char *zName){ |
| 1038 | - char *zValue = getenv(zName); | |
| 1039 | 1085 | #ifdef _WIN32 |
| 1040 | - if( zValue ) zValue = fossil_mbcs_to_utf8(zValue); | |
| 1086 | + wchar_t *uName = fossil_utf8_to_unicode(zName); | |
| 1087 | + void *zValue = _wgetenv(uName); | |
| 1088 | + fossil_mbcs_free(uName); | |
| 1089 | + if( zValue ) zValue = fossil_unicode_to_utf8(zValue); | |
| 1090 | +#else | |
| 1091 | + char *zValue = getenv(zName); | |
| 1041 | 1092 | #endif |
| 1042 | 1093 | return zValue; |
| 1043 | 1094 | } |
| 1044 | 1095 | |
| 1045 | 1096 | /* |
| @@ -1085,11 +1136,11 @@ | ||
| 1085 | 1136 | |
| 1086 | 1137 | /* |
| 1087 | 1138 | ** Translate MBCS to UTF8. Return a pointer. Call fossil_mbcs_free() |
| 1088 | 1139 | ** to deallocate any memory used to store the returned pointer when done. |
| 1089 | 1140 | */ |
| 1090 | -void fossil_mbcs_free(char *zOld){ | |
| 1141 | +void fossil_mbcs_free(void *zOld){ | |
| 1091 | 1142 | #ifdef _WIN32 |
| 1092 | 1143 | extern void sqlite3_free(void*); |
| 1093 | 1144 | sqlite3_free(zOld); |
| 1094 | 1145 | #else |
| 1095 | 1146 | /* No-op on unix */ |
| @@ -1098,10 +1149,16 @@ | ||
| 1098 | 1149 | |
| 1099 | 1150 | /* |
| 1100 | 1151 | ** Like fopen() but always takes a UTF8 argument. |
| 1101 | 1152 | */ |
| 1102 | 1153 | FILE *fossil_fopen(const char *zName, const char *zMode){ |
| 1103 | - char *zMbcs = fossil_utf8_to_mbcs(zName); | |
| 1104 | - FILE *f = fopen(zMbcs, zMode); | |
| 1105 | - fossil_mbcs_free(zMbcs); | |
| 1154 | +#ifdef _WIN32 | |
| 1155 | + wchar_t *uMode = fossil_utf8_to_unicode(zMode); | |
| 1156 | + wchar_t *uName = fossil_utf8_to_unicode(zName); | |
| 1157 | + FILE *f = _wfopen(uName, uMode); | |
| 1158 | + fossil_mbcs_free(uName); | |
| 1159 | + fossil_mbcs_free(uMode); | |
| 1160 | +#else | |
| 1161 | + FILE *f = fopen(zName, zMode); | |
| 1162 | +#endif | |
| 1106 | 1163 | return f; |
| 1107 | 1164 | } |
| 1108 | 1165 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2006 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -32,10 +32,11 @@ | |
| 32 | |
| 33 | /* |
| 34 | ** On Windows, include the Platform SDK header file. |
| 35 | */ |
| 36 | #ifdef _WIN32 |
| 37 | # include <windows.h> |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | ** The file status information from the most recent stat() call. |
| @@ -68,12 +69,12 @@ | |
| 68 | }else{ |
| 69 | return stat(zFilename, buf); |
| 70 | } |
| 71 | #else |
| 72 | int rc = 0; |
| 73 | char *zMbcs = fossil_utf8_to_mbcs(zFilename); |
| 74 | rc = stat(zMbcs, buf); |
| 75 | fossil_mbcs_free(zMbcs); |
| 76 | return rc; |
| 77 | #endif |
| 78 | } |
| 79 | |
| @@ -298,13 +299,17 @@ | |
| 298 | |
| 299 | /* |
| 300 | ** Wrapper around the access() system call. |
| 301 | */ |
| 302 | int file_access(const char *zFilename, int flags){ |
| 303 | char *zMbcs = fossil_utf8_to_mbcs(zFilename); |
| 304 | int rc = access(zMbcs, flags); |
| 305 | fossil_mbcs_free(zMbcs); |
| 306 | return rc; |
| 307 | } |
| 308 | |
| 309 | /* |
| 310 | ** Find an unused filename similar to zBase with zSuffix appended. |
| @@ -389,13 +394,17 @@ | |
| 389 | |
| 390 | /* |
| 391 | ** Delete a file. |
| 392 | */ |
| 393 | void file_delete(const char *zFilename){ |
| 394 | char *z = fossil_utf8_to_mbcs(zFilename); |
| 395 | unlink(z); |
| 396 | fossil_mbcs_free(z); |
| 397 | } |
| 398 | |
| 399 | /* |
| 400 | ** Create the directory named in the argument, if it does not already |
| 401 | ** exist. If forceFlag is 1, delete any prior non-directory object |
| @@ -410,12 +419,12 @@ | |
| 410 | file_delete(zName); |
| 411 | } |
| 412 | if( rc!=1 ){ |
| 413 | #if defined(_WIN32) |
| 414 | int rc; |
| 415 | char *zMbcs = fossil_utf8_to_mbcs(zName); |
| 416 | rc = mkdir(zMbcs); |
| 417 | fossil_mbcs_free(zMbcs); |
| 418 | return rc; |
| 419 | #else |
| 420 | return mkdir(zName, 0755); |
| 421 | #endif |
| @@ -561,24 +570,24 @@ | |
| 561 | } |
| 562 | |
| 563 | /* |
| 564 | ** Get the current working directory. |
| 565 | ** |
| 566 | ** On windows, the name is converted from MBCS to UTF8 and all '\\' |
| 567 | ** characters are converted to '/'. No conversions are needed on |
| 568 | ** unix. |
| 569 | */ |
| 570 | void file_getcwd(char *zBuf, int nBuf){ |
| 571 | #ifdef _WIN32 |
| 572 | char *zPwdUtf8; |
| 573 | int nPwd; |
| 574 | int i; |
| 575 | char zPwd[2000]; |
| 576 | if( getcwd(zPwd, sizeof(zPwd)-1)==0 ){ |
| 577 | fossil_fatal("cannot find the current working directory."); |
| 578 | } |
| 579 | zPwdUtf8 = fossil_mbcs_to_utf8(zPwd); |
| 580 | nPwd = strlen(zPwdUtf8); |
| 581 | if( nPwd > nBuf-1 ){ |
| 582 | fossil_fatal("pwd too big: max %d\n", nBuf-1); |
| 583 | } |
| 584 | for(i=0; zPwdUtf8[i]; i++) if( zPwdUtf8[i]=='\\' ) zPwdUtf8[i] = '/'; |
| @@ -928,14 +937,14 @@ | |
| 928 | unsigned int i, j; |
| 929 | const char *zDir = "."; |
| 930 | int cnt = 0; |
| 931 | |
| 932 | #if defined(_WIN32) |
| 933 | char zTmpPath[MAX_PATH]; |
| 934 | |
| 935 | if( GetTempPath(sizeof(zTmpPath), zTmpPath) ){ |
| 936 | azDirs[0] = zTmpPath; |
| 937 | } |
| 938 | |
| 939 | azDirs[1] = fossil_getenv("TEMP"); |
| 940 | azDirs[2] = fossil_getenv("TMP"); |
| 941 | #endif |
| @@ -1014,10 +1023,29 @@ | |
| 1014 | return sqlite3_win32_mbcs_to_utf8(zMbcs); |
| 1015 | #else |
| 1016 | return (char*)zMbcs; /* No-op on unix */ |
| 1017 | #endif |
| 1018 | } |
| 1019 | |
| 1020 | /* |
| 1021 | ** Translate UTF8 to MBCS for use in system calls. Return a pointer to the |
| 1022 | ** translated text.. Call fossil_mbcs_free() to deallocate any memory |
| 1023 | ** used to store the returned pointer when done. |
| @@ -1028,18 +1056,41 @@ | |
| 1028 | return sqlite3_win32_utf8_to_mbcs(zUtf8); |
| 1029 | #else |
| 1030 | return (char*)zUtf8; /* No-op on unix */ |
| 1031 | #endif |
| 1032 | } |
| 1033 | |
| 1034 | /* |
| 1035 | ** Return the value of an environment variable as UTF8. |
| 1036 | */ |
| 1037 | char *fossil_getenv(const char *zName){ |
| 1038 | char *zValue = getenv(zName); |
| 1039 | #ifdef _WIN32 |
| 1040 | if( zValue ) zValue = fossil_mbcs_to_utf8(zValue); |
| 1041 | #endif |
| 1042 | return zValue; |
| 1043 | } |
| 1044 | |
| 1045 | /* |
| @@ -1085,11 +1136,11 @@ | |
| 1085 | |
| 1086 | /* |
| 1087 | ** Translate MBCS to UTF8. Return a pointer. Call fossil_mbcs_free() |
| 1088 | ** to deallocate any memory used to store the returned pointer when done. |
| 1089 | */ |
| 1090 | void fossil_mbcs_free(char *zOld){ |
| 1091 | #ifdef _WIN32 |
| 1092 | extern void sqlite3_free(void*); |
| 1093 | sqlite3_free(zOld); |
| 1094 | #else |
| 1095 | /* No-op on unix */ |
| @@ -1098,10 +1149,16 @@ | |
| 1098 | |
| 1099 | /* |
| 1100 | ** Like fopen() but always takes a UTF8 argument. |
| 1101 | */ |
| 1102 | FILE *fossil_fopen(const char *zName, const char *zMode){ |
| 1103 | char *zMbcs = fossil_utf8_to_mbcs(zName); |
| 1104 | FILE *f = fopen(zMbcs, zMode); |
| 1105 | fossil_mbcs_free(zMbcs); |
| 1106 | return f; |
| 1107 | } |
| 1108 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2006 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -32,10 +32,11 @@ | |
| 32 | |
| 33 | /* |
| 34 | ** On Windows, include the Platform SDK header file. |
| 35 | */ |
| 36 | #ifdef _WIN32 |
| 37 | # include <direct.h> |
| 38 | # include <windows.h> |
| 39 | #endif |
| 40 | |
| 41 | /* |
| 42 | ** The file status information from the most recent stat() call. |
| @@ -68,12 +69,12 @@ | |
| 69 | }else{ |
| 70 | return stat(zFilename, buf); |
| 71 | } |
| 72 | #else |
| 73 | int rc = 0; |
| 74 | wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); |
| 75 | rc = _wstati64(zMbcs, buf); |
| 76 | fossil_mbcs_free(zMbcs); |
| 77 | return rc; |
| 78 | #endif |
| 79 | } |
| 80 | |
| @@ -298,13 +299,17 @@ | |
| 299 | |
| 300 | /* |
| 301 | ** Wrapper around the access() system call. |
| 302 | */ |
| 303 | int file_access(const char *zFilename, int flags){ |
| 304 | #ifdef _WIN32 |
| 305 | wchar_t *zMbcs = fossil_utf8_to_unicode(zFilename); |
| 306 | int rc = _waccess(zMbcs, flags); |
| 307 | fossil_mbcs_free(zMbcs); |
| 308 | #else |
| 309 | int rc = access(zFilename, flags); |
| 310 | #endif |
| 311 | return rc; |
| 312 | } |
| 313 | |
| 314 | /* |
| 315 | ** Find an unused filename similar to zBase with zSuffix appended. |
| @@ -389,13 +394,17 @@ | |
| 394 | |
| 395 | /* |
| 396 | ** Delete a file. |
| 397 | */ |
| 398 | void file_delete(const char *zFilename){ |
| 399 | #ifdef _WIN32 |
| 400 | wchar_t *z = fossil_utf8_to_unicode(zFilename); |
| 401 | _wunlink(z); |
| 402 | fossil_mbcs_free(z); |
| 403 | #else |
| 404 | unlink(zFilename); |
| 405 | #endif |
| 406 | } |
| 407 | |
| 408 | /* |
| 409 | ** Create the directory named in the argument, if it does not already |
| 410 | ** exist. If forceFlag is 1, delete any prior non-directory object |
| @@ -410,12 +419,12 @@ | |
| 419 | file_delete(zName); |
| 420 | } |
| 421 | if( rc!=1 ){ |
| 422 | #if defined(_WIN32) |
| 423 | int rc; |
| 424 | wchar_t *zMbcs = fossil_utf8_to_unicode(zName); |
| 425 | rc = _wmkdir(zMbcs); |
| 426 | fossil_mbcs_free(zMbcs); |
| 427 | return rc; |
| 428 | #else |
| 429 | return mkdir(zName, 0755); |
| 430 | #endif |
| @@ -561,24 +570,24 @@ | |
| 570 | } |
| 571 | |
| 572 | /* |
| 573 | ** Get the current working directory. |
| 574 | ** |
| 575 | ** On windows, the name is converted from unicode to UTF8 and all '\\' |
| 576 | ** characters are converted to '/'. No conversions are needed on |
| 577 | ** unix. |
| 578 | */ |
| 579 | void file_getcwd(char *zBuf, int nBuf){ |
| 580 | #ifdef _WIN32 |
| 581 | char *zPwdUtf8; |
| 582 | int nPwd; |
| 583 | int i; |
| 584 | wchar_t zPwd[2000]; |
| 585 | if( _wgetcwd(zPwd, sizeof(zPwd)-1)==0 ){ |
| 586 | fossil_fatal("cannot find the current working directory."); |
| 587 | } |
| 588 | zPwdUtf8 = fossil_unicode_to_utf8(zPwd); |
| 589 | nPwd = strlen(zPwdUtf8); |
| 590 | if( nPwd > nBuf-1 ){ |
| 591 | fossil_fatal("pwd too big: max %d\n", nBuf-1); |
| 592 | } |
| 593 | for(i=0; zPwdUtf8[i]; i++) if( zPwdUtf8[i]=='\\' ) zPwdUtf8[i] = '/'; |
| @@ -928,14 +937,14 @@ | |
| 937 | unsigned int i, j; |
| 938 | const char *zDir = "."; |
| 939 | int cnt = 0; |
| 940 | |
| 941 | #if defined(_WIN32) |
| 942 | wchar_t zTmpPath[MAX_PATH]; |
| 943 | |
| 944 | if( GetTempPathW(MAX_PATH, zTmpPath) ){ |
| 945 | azDirs[0] = fossil_unicode_to_utf8(zTmpPath); |
| 946 | } |
| 947 | |
| 948 | azDirs[1] = fossil_getenv("TEMP"); |
| 949 | azDirs[2] = fossil_getenv("TMP"); |
| 950 | #endif |
| @@ -1014,10 +1023,29 @@ | |
| 1023 | return sqlite3_win32_mbcs_to_utf8(zMbcs); |
| 1024 | #else |
| 1025 | return (char*)zMbcs; /* No-op on unix */ |
| 1026 | #endif |
| 1027 | } |
| 1028 | |
| 1029 | /* |
| 1030 | ** Translate Unicode to UTF8. Return a pointer to the translated text. |
| 1031 | ** Call fossil_mbcs_free() to deallocate any memory used to store the |
| 1032 | ** returned pointer when done. |
| 1033 | */ |
| 1034 | char *fossil_unicode_to_utf8(const void *zUnicode){ |
| 1035 | #ifdef _WIN32 |
| 1036 | int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0); |
| 1037 | char *zUtf = sqlite3_malloc( nByte ); |
| 1038 | if( zUtf==0 ){ |
| 1039 | return 0; |
| 1040 | } |
| 1041 | WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, zUtf, nByte, 0, 0); |
| 1042 | return zUtf; |
| 1043 | #else |
| 1044 | return (char *)zUnicode; /* No-op on unix */ |
| 1045 | #endif |
| 1046 | } |
| 1047 | |
| 1048 | /* |
| 1049 | ** Translate UTF8 to MBCS for use in system calls. Return a pointer to the |
| 1050 | ** translated text.. Call fossil_mbcs_free() to deallocate any memory |
| 1051 | ** used to store the returned pointer when done. |
| @@ -1028,18 +1056,41 @@ | |
| 1056 | return sqlite3_win32_utf8_to_mbcs(zUtf8); |
| 1057 | #else |
| 1058 | return (char*)zUtf8; /* No-op on unix */ |
| 1059 | #endif |
| 1060 | } |
| 1061 | |
| 1062 | /* |
| 1063 | ** Translate UTF8 to unicode for use in system calls. Return a pointer to the |
| 1064 | ** translated text.. Call fossil_mbcs_free() to deallocate any memory |
| 1065 | ** used to store the returned pointer when done. |
| 1066 | */ |
| 1067 | void *fossil_utf8_to_unicode(const char *zUtf8){ |
| 1068 | #ifdef _WIN32 |
| 1069 | int nByte = MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, 0, 0); |
| 1070 | wchar_t *zUnicode = sqlite3_malloc( nByte * 2 ); |
| 1071 | if( zUnicode==0 ){ |
| 1072 | return 0; |
| 1073 | } |
| 1074 | MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, zUnicode, nByte); |
| 1075 | return zUnicode; |
| 1076 | #else |
| 1077 | return (void *)zUtf8; /* No-op on unix */ |
| 1078 | #endif |
| 1079 | } |
| 1080 | |
| 1081 | /* |
| 1082 | ** Return the value of an environment variable as UTF8. |
| 1083 | */ |
| 1084 | char *fossil_getenv(const char *zName){ |
| 1085 | #ifdef _WIN32 |
| 1086 | wchar_t *uName = fossil_utf8_to_unicode(zName); |
| 1087 | void *zValue = _wgetenv(uName); |
| 1088 | fossil_mbcs_free(uName); |
| 1089 | if( zValue ) zValue = fossil_unicode_to_utf8(zValue); |
| 1090 | #else |
| 1091 | char *zValue = getenv(zName); |
| 1092 | #endif |
| 1093 | return zValue; |
| 1094 | } |
| 1095 | |
| 1096 | /* |
| @@ -1085,11 +1136,11 @@ | |
| 1136 | |
| 1137 | /* |
| 1138 | ** Translate MBCS to UTF8. Return a pointer. Call fossil_mbcs_free() |
| 1139 | ** to deallocate any memory used to store the returned pointer when done. |
| 1140 | */ |
| 1141 | void fossil_mbcs_free(void *zOld){ |
| 1142 | #ifdef _WIN32 |
| 1143 | extern void sqlite3_free(void*); |
| 1144 | sqlite3_free(zOld); |
| 1145 | #else |
| 1146 | /* No-op on unix */ |
| @@ -1098,10 +1149,16 @@ | |
| 1149 | |
| 1150 | /* |
| 1151 | ** Like fopen() but always takes a UTF8 argument. |
| 1152 | */ |
| 1153 | FILE *fossil_fopen(const char *zName, const char *zMode){ |
| 1154 | #ifdef _WIN32 |
| 1155 | wchar_t *uMode = fossil_utf8_to_unicode(zMode); |
| 1156 | wchar_t *uName = fossil_utf8_to_unicode(zName); |
| 1157 | FILE *f = _wfopen(uName, uMode); |
| 1158 | fossil_mbcs_free(uName); |
| 1159 | fossil_mbcs_free(uMode); |
| 1160 | #else |
| 1161 | FILE *f = fopen(zName, zMode); |
| 1162 | #endif |
| 1163 | return f; |
| 1164 | } |
| 1165 |
+2
-2
| --- src/import.c | ||
| +++ src/import.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2010 D. Richard Hipp | |
| 2 | +** Copyright © 2010 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -732,11 +732,11 @@ | ||
| 732 | 732 | verify_all_options(); |
| 733 | 733 | if( g.argc!=3 && g.argc!=4 ){ |
| 734 | 734 | usage("REPOSITORY-NAME"); |
| 735 | 735 | } |
| 736 | 736 | if( g.argc==4 ){ |
| 737 | - pIn = fopen(g.argv[3], "rb"); | |
| 737 | + pIn = fossil_fopen(g.argv[3], "rb"); | |
| 738 | 738 | }else{ |
| 739 | 739 | pIn = stdin; |
| 740 | 740 | fossil_binary_mode(pIn); |
| 741 | 741 | } |
| 742 | 742 | if( !incrFlag ){ |
| 743 | 743 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2010 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -732,11 +732,11 @@ | |
| 732 | verify_all_options(); |
| 733 | if( g.argc!=3 && g.argc!=4 ){ |
| 734 | usage("REPOSITORY-NAME"); |
| 735 | } |
| 736 | if( g.argc==4 ){ |
| 737 | pIn = fopen(g.argv[3], "rb"); |
| 738 | }else{ |
| 739 | pIn = stdin; |
| 740 | fossil_binary_mode(pIn); |
| 741 | } |
| 742 | if( !incrFlag ){ |
| 743 |
| --- src/import.c | |
| +++ src/import.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2010 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -732,11 +732,11 @@ | |
| 732 | verify_all_options(); |
| 733 | if( g.argc!=3 && g.argc!=4 ){ |
| 734 | usage("REPOSITORY-NAME"); |
| 735 | } |
| 736 | if( g.argc==4 ){ |
| 737 | pIn = fossil_fopen(g.argv[3], "rb"); |
| 738 | }else{ |
| 739 | pIn = stdin; |
| 740 | fossil_binary_mode(pIn); |
| 741 | } |
| 742 | if( !incrFlag ){ |
| 743 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1540,11 +1540,11 @@ | ||
| 1540 | 1540 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1541 | 1541 | memcpy(zTktName, pTktChng->zTicketUuid, 10); |
| 1542 | 1542 | zTktName[10] = 0; |
| 1543 | 1543 | if( g.perm.Hyperlink ){ |
| 1544 | 1544 | @ <h2>Changes to ticket |
| 1545 | - @ %z(href("%R/tktview/%s",pTktChng->zTicketUuid)))%s(zTktName)</a></h2> | |
| 1545 | + @ %z(href("%R/tktview/%s",pTktChng->zTicketUuid))%s(zTktName)</a></h2> | |
| 1546 | 1546 | @ |
| 1547 | 1547 | @ <p>By %h(pTktChng->zUser) on %s(zDate). See also: |
| 1548 | 1548 | @ %z(href("%R/artifact/%T",zUuid))artifact content</a>, and |
| 1549 | 1549 | @ %z(href("%R/tkthistory/%s",pTktChng->zTicketUuid))ticket history</a></p> |
| 1550 | 1550 | }else{ |
| 1551 | 1551 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1540,11 +1540,11 @@ | |
| 1540 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1541 | memcpy(zTktName, pTktChng->zTicketUuid, 10); |
| 1542 | zTktName[10] = 0; |
| 1543 | if( g.perm.Hyperlink ){ |
| 1544 | @ <h2>Changes to ticket |
| 1545 | @ %z(href("%R/tktview/%s",pTktChng->zTicketUuid)))%s(zTktName)</a></h2> |
| 1546 | @ |
| 1547 | @ <p>By %h(pTktChng->zUser) on %s(zDate). See also: |
| 1548 | @ %z(href("%R/artifact/%T",zUuid))artifact content</a>, and |
| 1549 | @ %z(href("%R/tkthistory/%s",pTktChng->zTicketUuid))ticket history</a></p> |
| 1550 | }else{ |
| 1551 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1540,11 +1540,11 @@ | |
| 1540 | zDate = db_text(0, "SELECT datetime(%.12f)", pTktChng->rDate); |
| 1541 | memcpy(zTktName, pTktChng->zTicketUuid, 10); |
| 1542 | zTktName[10] = 0; |
| 1543 | if( g.perm.Hyperlink ){ |
| 1544 | @ <h2>Changes to ticket |
| 1545 | @ %z(href("%R/tktview/%s",pTktChng->zTicketUuid))%s(zTktName)</a></h2> |
| 1546 | @ |
| 1547 | @ <p>By %h(pTktChng->zUser) on %s(zDate). See also: |
| 1548 | @ %z(href("%R/artifact/%T",zUuid))artifact content</a>, and |
| 1549 | @ %z(href("%R/tkthistory/%s",pTktChng->zTicketUuid))ticket history</a></p> |
| 1550 | }else{ |
| 1551 |
+17
-8
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -21,10 +21,19 @@ | ||
| 21 | 21 | #include "rebuild.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 23 | #include <dirent.h> |
| 24 | 24 | #include <errno.h> |
| 25 | 25 | |
| 26 | +#ifndef _WIN32 | |
| 27 | +#define _WDIR DIR | |
| 28 | +#define _wdirent dirent | |
| 29 | +#define _wopendir opendir | |
| 30 | +#define _wreaddir readdir | |
| 31 | +#define _wclosedir closedir | |
| 32 | +#define wchar_t char | |
| 33 | +#endif | |
| 34 | + | |
| 26 | 35 | /* |
| 27 | 36 | ** Make changes to the stable part of the schema (the part that is not |
| 28 | 37 | ** simply deleted and reconstructed on a rebuild) to bring the schema |
| 29 | 38 | ** up to the latest. |
| 30 | 39 | */ |
| @@ -818,28 +827,28 @@ | ||
| 818 | 827 | /* |
| 819 | 828 | ** Recursively read all files from the directory zPath and install |
| 820 | 829 | ** every file read as a new artifact in the repository. |
| 821 | 830 | */ |
| 822 | 831 | void recon_read_dir(char *zPath){ |
| 823 | - DIR *d; | |
| 824 | - struct dirent *pEntry; | |
| 832 | + _WDIR *d; | |
| 833 | + struct _wdirent *pEntry; | |
| 825 | 834 | Blob aContent; /* content of the just read artifact */ |
| 826 | 835 | static int nFileRead = 0; |
| 827 | - char *zMbcsPath; | |
| 836 | + wchar_t *zMbcsPath; | |
| 828 | 837 | char *zUtf8Name; |
| 829 | 838 | |
| 830 | - zMbcsPath = fossil_utf8_to_mbcs(zPath); | |
| 831 | - d = opendir(zMbcsPath); | |
| 839 | + zMbcsPath = fossil_utf8_to_unicode(zPath); | |
| 840 | + d = _wopendir(zMbcsPath); | |
| 832 | 841 | if( d ){ |
| 833 | - while( (pEntry=readdir(d))!=0 ){ | |
| 842 | + while( (pEntry=_wreaddir(d))!=0 ){ | |
| 834 | 843 | Blob path; |
| 835 | 844 | char *zSubpath; |
| 836 | 845 | |
| 837 | 846 | if( pEntry->d_name[0]=='.' ){ |
| 838 | 847 | continue; |
| 839 | 848 | } |
| 840 | - zUtf8Name = fossil_mbcs_to_utf8(pEntry->d_name); | |
| 849 | + zUtf8Name = fossil_unicode_to_utf8(pEntry->d_name); | |
| 841 | 850 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 842 | 851 | fossil_mbcs_free(zUtf8Name); |
| 843 | 852 | if( file_isdir(zSubpath)==1 ){ |
| 844 | 853 | recon_read_dir(zSubpath); |
| 845 | 854 | } |
| @@ -854,11 +863,11 @@ | ||
| 854 | 863 | blob_reset(&aContent); |
| 855 | 864 | free(zSubpath); |
| 856 | 865 | fossil_print("\r%d", ++nFileRead); |
| 857 | 866 | fflush(stdout); |
| 858 | 867 | } |
| 859 | - closedir(d); | |
| 868 | + _wclosedir(d); | |
| 860 | 869 | }else { |
| 861 | 870 | fossil_panic("encountered error %d while trying to open \"%s\".", |
| 862 | 871 | errno, g.argv[3]); |
| 863 | 872 | } |
| 864 | 873 | fossil_mbcs_free(zMbcsPath); |
| 865 | 874 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -21,10 +21,19 @@ | |
| 21 | #include "rebuild.h" |
| 22 | #include <assert.h> |
| 23 | #include <dirent.h> |
| 24 | #include <errno.h> |
| 25 | |
| 26 | /* |
| 27 | ** Make changes to the stable part of the schema (the part that is not |
| 28 | ** simply deleted and reconstructed on a rebuild) to bring the schema |
| 29 | ** up to the latest. |
| 30 | */ |
| @@ -818,28 +827,28 @@ | |
| 818 | /* |
| 819 | ** Recursively read all files from the directory zPath and install |
| 820 | ** every file read as a new artifact in the repository. |
| 821 | */ |
| 822 | void recon_read_dir(char *zPath){ |
| 823 | DIR *d; |
| 824 | struct dirent *pEntry; |
| 825 | Blob aContent; /* content of the just read artifact */ |
| 826 | static int nFileRead = 0; |
| 827 | char *zMbcsPath; |
| 828 | char *zUtf8Name; |
| 829 | |
| 830 | zMbcsPath = fossil_utf8_to_mbcs(zPath); |
| 831 | d = opendir(zMbcsPath); |
| 832 | if( d ){ |
| 833 | while( (pEntry=readdir(d))!=0 ){ |
| 834 | Blob path; |
| 835 | char *zSubpath; |
| 836 | |
| 837 | if( pEntry->d_name[0]=='.' ){ |
| 838 | continue; |
| 839 | } |
| 840 | zUtf8Name = fossil_mbcs_to_utf8(pEntry->d_name); |
| 841 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 842 | fossil_mbcs_free(zUtf8Name); |
| 843 | if( file_isdir(zSubpath)==1 ){ |
| 844 | recon_read_dir(zSubpath); |
| 845 | } |
| @@ -854,11 +863,11 @@ | |
| 854 | blob_reset(&aContent); |
| 855 | free(zSubpath); |
| 856 | fossil_print("\r%d", ++nFileRead); |
| 857 | fflush(stdout); |
| 858 | } |
| 859 | closedir(d); |
| 860 | }else { |
| 861 | fossil_panic("encountered error %d while trying to open \"%s\".", |
| 862 | errno, g.argv[3]); |
| 863 | } |
| 864 | fossil_mbcs_free(zMbcsPath); |
| 865 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -21,10 +21,19 @@ | |
| 21 | #include "rebuild.h" |
| 22 | #include <assert.h> |
| 23 | #include <dirent.h> |
| 24 | #include <errno.h> |
| 25 | |
| 26 | #ifndef _WIN32 |
| 27 | #define _WDIR DIR |
| 28 | #define _wdirent dirent |
| 29 | #define _wopendir opendir |
| 30 | #define _wreaddir readdir |
| 31 | #define _wclosedir closedir |
| 32 | #define wchar_t char |
| 33 | #endif |
| 34 | |
| 35 | /* |
| 36 | ** Make changes to the stable part of the schema (the part that is not |
| 37 | ** simply deleted and reconstructed on a rebuild) to bring the schema |
| 38 | ** up to the latest. |
| 39 | */ |
| @@ -818,28 +827,28 @@ | |
| 827 | /* |
| 828 | ** Recursively read all files from the directory zPath and install |
| 829 | ** every file read as a new artifact in the repository. |
| 830 | */ |
| 831 | void recon_read_dir(char *zPath){ |
| 832 | _WDIR *d; |
| 833 | struct _wdirent *pEntry; |
| 834 | Blob aContent; /* content of the just read artifact */ |
| 835 | static int nFileRead = 0; |
| 836 | wchar_t *zMbcsPath; |
| 837 | char *zUtf8Name; |
| 838 | |
| 839 | zMbcsPath = fossil_utf8_to_unicode(zPath); |
| 840 | d = _wopendir(zMbcsPath); |
| 841 | if( d ){ |
| 842 | while( (pEntry=_wreaddir(d))!=0 ){ |
| 843 | Blob path; |
| 844 | char *zSubpath; |
| 845 | |
| 846 | if( pEntry->d_name[0]=='.' ){ |
| 847 | continue; |
| 848 | } |
| 849 | zUtf8Name = fossil_unicode_to_utf8(pEntry->d_name); |
| 850 | zSubpath = mprintf("%s/%s", zPath, zUtf8Name); |
| 851 | fossil_mbcs_free(zUtf8Name); |
| 852 | if( file_isdir(zSubpath)==1 ){ |
| 853 | recon_read_dir(zSubpath); |
| 854 | } |
| @@ -854,11 +863,11 @@ | |
| 863 | blob_reset(&aContent); |
| 864 | free(zSubpath); |
| 865 | fossil_print("\r%d", ++nFileRead); |
| 866 | fflush(stdout); |
| 867 | } |
| 868 | _wclosedir(d); |
| 869 | }else { |
| 870 | fossil_panic("encountered error %d while trying to open \"%s\".", |
| 871 | errno, g.argv[3]); |
| 872 | } |
| 873 | fossil_mbcs_free(zMbcsPath); |
| 874 |
+12
-12
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -496,38 +496,38 @@ | ||
| 496 | 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | 497 | char *z1, *z2; |
| 498 | 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | 499 | while( z1 && *z1 ){ |
| 500 | 500 | inherit[0x7f & *(z1++)] = |
| 501 | - "<span class=\"ueditInheritDeveloper\">•</span>"; | |
| 501 | + "<span class=\"ueditInheritDeveloper\">•</span>"; | |
| 502 | 502 | } |
| 503 | 503 | free(z2); |
| 504 | 504 | } |
| 505 | 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | 506 | char *z1, *z2; |
| 507 | 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | 508 | while( z1 && *z1 ){ |
| 509 | 509 | inherit[0x7f & *(z1++)] = |
| 510 | - "<span class=\"ueditInheritReader\">•</span>"; | |
| 510 | + "<span class=\"ueditInheritReader\">•</span>"; | |
| 511 | 511 | } |
| 512 | 512 | free(z2); |
| 513 | 513 | } |
| 514 | 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | 515 | char *z1, *z2; |
| 516 | 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | 517 | while( z1 && *z1 ){ |
| 518 | 518 | inherit[0x7f & *(z1++)] = |
| 519 | - "<span class=\"ueditInheritAnonymous\">•</span>"; | |
| 519 | + "<span class=\"ueditInheritAnonymous\">•</span>"; | |
| 520 | 520 | } |
| 521 | 521 | free(z2); |
| 522 | 522 | } |
| 523 | 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | 524 | char *z1, *z2; |
| 525 | 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | 526 | while( z1 && *z1 ){ |
| 527 | 527 | inherit[0x7f & *(z1++)] = |
| 528 | - "<span class=\"ueditInheritNobody\">•</span>"; | |
| 528 | + "<span class=\"ueditInheritNobody\">•</span>"; | |
| 529 | 529 | } |
| 530 | 530 | free(z2); |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | ||
| 662 | 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | 663 | @ listed below. Use these two settings with discretion. |
| 664 | 664 | @ </p></li> |
| 665 | 665 | @ |
| 666 | 666 | @ <li><p> |
| 667 | - @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark | |
| 667 | + @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark | |
| 668 | 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | 670 | @ </p></li> |
| 671 | 671 | @ |
| 672 | 672 | @ <li><p> |
| 673 | - @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark | |
| 673 | + @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark | |
| 674 | 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | 675 | @ are inherited by all logged-in users. |
| 676 | 676 | @ </p></li> |
| 677 | 677 | @ |
| 678 | 678 | @ <li><p> |
| 679 | - @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark | |
| 679 | + @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark | |
| 680 | 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | 681 | @ are inherited by all users with the |
| 682 | 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | 683 | @ </p></li> |
| 684 | 684 | @ |
| 685 | 685 | @ <li><p> |
| 686 | - @ The "<span class="ueditInheritReader"><big>•</big></span>" mark | |
| 686 | + @ The "<span class="ueditInheritReader"><big>•</big></span>" mark | |
| 687 | 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | 689 | @ privilege. |
| 690 | 690 | @ </p></li> |
| 691 | 691 | @ |
| @@ -1616,16 +1616,16 @@ | ||
| 1616 | 1616 | style_header("Raw SQL Commands"); |
| 1617 | 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | 1620 | @ |
| 1621 | - @ <p>Database names:<ul><li>repository → %s(db_name("repository")) | |
| 1621 | + @ <p>Database names:<ul><li>repository → %s(db_name("repository")) | |
| 1622 | 1622 | if( g.configOpen ){ |
| 1623 | - @ <li>config → %s(db_name("configdb")) | |
| 1623 | + @ <li>config → %s(db_name("configdb")) | |
| 1624 | 1624 | } |
| 1625 | 1625 | if( g.localOpen ){ |
| 1626 | - @ <li>local-checkout → %s(db_name("localdb")) | |
| 1626 | + @ <li>local-checkout → %s(db_name("localdb")) | |
| 1627 | 1627 | } |
| 1628 | 1628 | @ </ul></p> |
| 1629 | 1629 | @ |
| 1630 | 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | 1631 | login_insert_csrf_secret(); |
| 1632 | 1632 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -496,38 +496,38 @@ | |
| 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | char *z1, *z2; |
| 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | while( z1 && *z1 ){ |
| 500 | inherit[0x7f & *(z1++)] = |
| 501 | "<span class=\"ueditInheritDeveloper\">•</span>"; |
| 502 | } |
| 503 | free(z2); |
| 504 | } |
| 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | char *z1, *z2; |
| 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | while( z1 && *z1 ){ |
| 509 | inherit[0x7f & *(z1++)] = |
| 510 | "<span class=\"ueditInheritReader\">•</span>"; |
| 511 | } |
| 512 | free(z2); |
| 513 | } |
| 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | char *z1, *z2; |
| 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | while( z1 && *z1 ){ |
| 518 | inherit[0x7f & *(z1++)] = |
| 519 | "<span class=\"ueditInheritAnonymous\">•</span>"; |
| 520 | } |
| 521 | free(z2); |
| 522 | } |
| 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | char *z1, *z2; |
| 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | while( z1 && *z1 ){ |
| 527 | inherit[0x7f & *(z1++)] = |
| 528 | "<span class=\"ueditInheritNobody\">•</span>"; |
| 529 | } |
| 530 | free(z2); |
| 531 | } |
| 532 | |
| 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | |
| 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | @ listed below. Use these two settings with discretion. |
| 664 | @ </p></li> |
| 665 | @ |
| 666 | @ <li><p> |
| 667 | @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark |
| 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | @ </p></li> |
| 671 | @ |
| 672 | @ <li><p> |
| 673 | @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark |
| 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | @ are inherited by all logged-in users. |
| 676 | @ </p></li> |
| 677 | @ |
| 678 | @ <li><p> |
| 679 | @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark |
| 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | @ are inherited by all users with the |
| 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | @ </p></li> |
| 684 | @ |
| 685 | @ <li><p> |
| 686 | @ The "<span class="ueditInheritReader"><big>•</big></span>" mark |
| 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | @ privilege. |
| 690 | @ </p></li> |
| 691 | @ |
| @@ -1616,16 +1616,16 @@ | |
| 1616 | style_header("Raw SQL Commands"); |
| 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | @ |
| 1621 | @ <p>Database names:<ul><li>repository → %s(db_name("repository")) |
| 1622 | if( g.configOpen ){ |
| 1623 | @ <li>config → %s(db_name("configdb")) |
| 1624 | } |
| 1625 | if( g.localOpen ){ |
| 1626 | @ <li>local-checkout → %s(db_name("localdb")) |
| 1627 | } |
| 1628 | @ </ul></p> |
| 1629 | @ |
| 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | login_insert_csrf_secret(); |
| 1632 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -496,38 +496,38 @@ | |
| 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | char *z1, *z2; |
| 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | while( z1 && *z1 ){ |
| 500 | inherit[0x7f & *(z1++)] = |
| 501 | "<span class=\"ueditInheritDeveloper\">•</span>"; |
| 502 | } |
| 503 | free(z2); |
| 504 | } |
| 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | char *z1, *z2; |
| 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | while( z1 && *z1 ){ |
| 509 | inherit[0x7f & *(z1++)] = |
| 510 | "<span class=\"ueditInheritReader\">•</span>"; |
| 511 | } |
| 512 | free(z2); |
| 513 | } |
| 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | char *z1, *z2; |
| 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | while( z1 && *z1 ){ |
| 518 | inherit[0x7f & *(z1++)] = |
| 519 | "<span class=\"ueditInheritAnonymous\">•</span>"; |
| 520 | } |
| 521 | free(z2); |
| 522 | } |
| 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | char *z1, *z2; |
| 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | while( z1 && *z1 ){ |
| 527 | inherit[0x7f & *(z1++)] = |
| 528 | "<span class=\"ueditInheritNobody\">•</span>"; |
| 529 | } |
| 530 | free(z2); |
| 531 | } |
| 532 | |
| 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | |
| 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | @ listed below. Use these two settings with discretion. |
| 664 | @ </p></li> |
| 665 | @ |
| 666 | @ <li><p> |
| 667 | @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark |
| 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | @ </p></li> |
| 671 | @ |
| 672 | @ <li><p> |
| 673 | @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark |
| 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | @ are inherited by all logged-in users. |
| 676 | @ </p></li> |
| 677 | @ |
| 678 | @ <li><p> |
| 679 | @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark |
| 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | @ are inherited by all users with the |
| 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | @ </p></li> |
| 684 | @ |
| 685 | @ <li><p> |
| 686 | @ The "<span class="ueditInheritReader"><big>•</big></span>" mark |
| 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | @ privilege. |
| 690 | @ </p></li> |
| 691 | @ |
| @@ -1616,16 +1616,16 @@ | |
| 1616 | style_header("Raw SQL Commands"); |
| 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | @ |
| 1621 | @ <p>Database names:<ul><li>repository → %s(db_name("repository")) |
| 1622 | if( g.configOpen ){ |
| 1623 | @ <li>config → %s(db_name("configdb")) |
| 1624 | } |
| 1625 | if( g.localOpen ){ |
| 1626 | @ <li>local-checkout → %s(db_name("localdb")) |
| 1627 | } |
| 1628 | @ </ul></p> |
| 1629 | @ |
| 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | login_insert_csrf_secret(); |
| 1632 |
+12
-12
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -496,38 +496,38 @@ | ||
| 496 | 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | 497 | char *z1, *z2; |
| 498 | 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | 499 | while( z1 && *z1 ){ |
| 500 | 500 | inherit[0x7f & *(z1++)] = |
| 501 | - "<span class=\"ueditInheritDeveloper\">•</span>"; | |
| 501 | + "<span class=\"ueditInheritDeveloper\">•</span>"; | |
| 502 | 502 | } |
| 503 | 503 | free(z2); |
| 504 | 504 | } |
| 505 | 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | 506 | char *z1, *z2; |
| 507 | 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | 508 | while( z1 && *z1 ){ |
| 509 | 509 | inherit[0x7f & *(z1++)] = |
| 510 | - "<span class=\"ueditInheritReader\">•</span>"; | |
| 510 | + "<span class=\"ueditInheritReader\">•</span>"; | |
| 511 | 511 | } |
| 512 | 512 | free(z2); |
| 513 | 513 | } |
| 514 | 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | 515 | char *z1, *z2; |
| 516 | 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | 517 | while( z1 && *z1 ){ |
| 518 | 518 | inherit[0x7f & *(z1++)] = |
| 519 | - "<span class=\"ueditInheritAnonymous\">•</span>"; | |
| 519 | + "<span class=\"ueditInheritAnonymous\">•</span>"; | |
| 520 | 520 | } |
| 521 | 521 | free(z2); |
| 522 | 522 | } |
| 523 | 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | 524 | char *z1, *z2; |
| 525 | 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | 526 | while( z1 && *z1 ){ |
| 527 | 527 | inherit[0x7f & *(z1++)] = |
| 528 | - "<span class=\"ueditInheritNobody\">•</span>"; | |
| 528 | + "<span class=\"ueditInheritNobody\">•</span>"; | |
| 529 | 529 | } |
| 530 | 530 | free(z2); |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | ||
| 662 | 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | 663 | @ listed below. Use these two settings with discretion. |
| 664 | 664 | @ </p></li> |
| 665 | 665 | @ |
| 666 | 666 | @ <li><p> |
| 667 | - @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark | |
| 667 | + @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark | |
| 668 | 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | 670 | @ </p></li> |
| 671 | 671 | @ |
| 672 | 672 | @ <li><p> |
| 673 | - @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark | |
| 673 | + @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark | |
| 674 | 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | 675 | @ are inherited by all logged-in users. |
| 676 | 676 | @ </p></li> |
| 677 | 677 | @ |
| 678 | 678 | @ <li><p> |
| 679 | - @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark | |
| 679 | + @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark | |
| 680 | 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | 681 | @ are inherited by all users with the |
| 682 | 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | 683 | @ </p></li> |
| 684 | 684 | @ |
| 685 | 685 | @ <li><p> |
| 686 | - @ The "<span class="ueditInheritReader"><big>•</big></span>" mark | |
| 686 | + @ The "<span class="ueditInheritReader"><big>•</big></span>" mark | |
| 687 | 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | 689 | @ privilege. |
| 690 | 690 | @ </p></li> |
| 691 | 691 | @ |
| @@ -1616,16 +1616,16 @@ | ||
| 1616 | 1616 | style_header("Raw SQL Commands"); |
| 1617 | 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | 1620 | @ |
| 1621 | - @ <p>Database names:<ul><li>repository → %s(db_name("repository")) | |
| 1621 | + @ <p>Database names:<ul><li>repository → %s(db_name("repository")) | |
| 1622 | 1622 | if( g.configOpen ){ |
| 1623 | - @ <li>config → %s(db_name("configdb")) | |
| 1623 | + @ <li>config → %s(db_name("configdb")) | |
| 1624 | 1624 | } |
| 1625 | 1625 | if( g.localOpen ){ |
| 1626 | - @ <li>local-checkout → %s(db_name("localdb")) | |
| 1626 | + @ <li>local-checkout → %s(db_name("localdb")) | |
| 1627 | 1627 | } |
| 1628 | 1628 | @ </ul></p> |
| 1629 | 1629 | @ |
| 1630 | 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | 1631 | login_insert_csrf_secret(); |
| 1632 | 1632 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -496,38 +496,38 @@ | |
| 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | char *z1, *z2; |
| 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | while( z1 && *z1 ){ |
| 500 | inherit[0x7f & *(z1++)] = |
| 501 | "<span class=\"ueditInheritDeveloper\">•</span>"; |
| 502 | } |
| 503 | free(z2); |
| 504 | } |
| 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | char *z1, *z2; |
| 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | while( z1 && *z1 ){ |
| 509 | inherit[0x7f & *(z1++)] = |
| 510 | "<span class=\"ueditInheritReader\">•</span>"; |
| 511 | } |
| 512 | free(z2); |
| 513 | } |
| 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | char *z1, *z2; |
| 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | while( z1 && *z1 ){ |
| 518 | inherit[0x7f & *(z1++)] = |
| 519 | "<span class=\"ueditInheritAnonymous\">•</span>"; |
| 520 | } |
| 521 | free(z2); |
| 522 | } |
| 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | char *z1, *z2; |
| 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | while( z1 && *z1 ){ |
| 527 | inherit[0x7f & *(z1++)] = |
| 528 | "<span class=\"ueditInheritNobody\">•</span>"; |
| 529 | } |
| 530 | free(z2); |
| 531 | } |
| 532 | |
| 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | |
| 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | @ listed below. Use these two settings with discretion. |
| 664 | @ </p></li> |
| 665 | @ |
| 666 | @ <li><p> |
| 667 | @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark |
| 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | @ </p></li> |
| 671 | @ |
| 672 | @ <li><p> |
| 673 | @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark |
| 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | @ are inherited by all logged-in users. |
| 676 | @ </p></li> |
| 677 | @ |
| 678 | @ <li><p> |
| 679 | @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark |
| 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | @ are inherited by all users with the |
| 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | @ </p></li> |
| 684 | @ |
| 685 | @ <li><p> |
| 686 | @ The "<span class="ueditInheritReader"><big>•</big></span>" mark |
| 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | @ privilege. |
| 690 | @ </p></li> |
| 691 | @ |
| @@ -1616,16 +1616,16 @@ | |
| 1616 | style_header("Raw SQL Commands"); |
| 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | @ |
| 1621 | @ <p>Database names:<ul><li>repository → %s(db_name("repository")) |
| 1622 | if( g.configOpen ){ |
| 1623 | @ <li>config → %s(db_name("configdb")) |
| 1624 | } |
| 1625 | if( g.localOpen ){ |
| 1626 | @ <li>local-checkout → %s(db_name("localdb")) |
| 1627 | } |
| 1628 | @ </ul></p> |
| 1629 | @ |
| 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | login_insert_csrf_secret(); |
| 1632 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -496,38 +496,38 @@ | |
| 496 | if( fossil_strcmp(zLogin, "developer") ){ |
| 497 | char *z1, *z2; |
| 498 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'"); |
| 499 | while( z1 && *z1 ){ |
| 500 | inherit[0x7f & *(z1++)] = |
| 501 | "<span class=\"ueditInheritDeveloper\">•</span>"; |
| 502 | } |
| 503 | free(z2); |
| 504 | } |
| 505 | if( fossil_strcmp(zLogin, "reader") ){ |
| 506 | char *z1, *z2; |
| 507 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'"); |
| 508 | while( z1 && *z1 ){ |
| 509 | inherit[0x7f & *(z1++)] = |
| 510 | "<span class=\"ueditInheritReader\">•</span>"; |
| 511 | } |
| 512 | free(z2); |
| 513 | } |
| 514 | if( fossil_strcmp(zLogin, "anonymous") ){ |
| 515 | char *z1, *z2; |
| 516 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'"); |
| 517 | while( z1 && *z1 ){ |
| 518 | inherit[0x7f & *(z1++)] = |
| 519 | "<span class=\"ueditInheritAnonymous\">•</span>"; |
| 520 | } |
| 521 | free(z2); |
| 522 | } |
| 523 | if( fossil_strcmp(zLogin, "nobody") ){ |
| 524 | char *z1, *z2; |
| 525 | z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'"); |
| 526 | while( z1 && *z1 ){ |
| 527 | inherit[0x7f & *(z1++)] = |
| 528 | "<span class=\"ueditInheritNobody\">•</span>"; |
| 529 | } |
| 530 | free(z2); |
| 531 | } |
| 532 | |
| 533 | /* Begin generating the page |
| @@ -662,30 +662,30 @@ | |
| 662 | @ and reset user passwords. Both automatically get all other privileges |
| 663 | @ listed below. Use these two settings with discretion. |
| 664 | @ </p></li> |
| 665 | @ |
| 666 | @ <li><p> |
| 667 | @ The "<span class="ueditInheritNobody"><big>•</big></span>" mark |
| 668 | @ indicates the privileges of <span class="usertype">nobody</span> that |
| 669 | @ are available to all users regardless of whether or not they are logged in. |
| 670 | @ </p></li> |
| 671 | @ |
| 672 | @ <li><p> |
| 673 | @ The "<span class="ueditInheritAnonymous"><big>•</big></span>" mark |
| 674 | @ indicates the privileges of <span class="usertype">anonymous</span> that |
| 675 | @ are inherited by all logged-in users. |
| 676 | @ </p></li> |
| 677 | @ |
| 678 | @ <li><p> |
| 679 | @ The "<span class="ueditInheritDeveloper"><big>•</big></span>" mark |
| 680 | @ indicates the privileges of <span class="usertype">developer</span> that |
| 681 | @ are inherited by all users with the |
| 682 | @ <span class="capability">Developer</span> privilege. |
| 683 | @ </p></li> |
| 684 | @ |
| 685 | @ <li><p> |
| 686 | @ The "<span class="ueditInheritReader"><big>•</big></span>" mark |
| 687 | @ indicates the privileges of <span class="usertype">reader</span> that |
| 688 | @ are inherited by all users with the <span class="capability">Reader</span> |
| 689 | @ privilege. |
| 690 | @ </p></li> |
| 691 | @ |
| @@ -1616,16 +1616,16 @@ | |
| 1616 | style_header("Raw SQL Commands"); |
| 1617 | @ <p><b>Caution:</b> There are no restrictions on the SQL that can be |
| 1618 | @ run by this page. You can do serious and irrepairable damage to the |
| 1619 | @ repository. Proceed with extreme caution.</p> |
| 1620 | @ |
| 1621 | @ <p>Database names:<ul><li>repository → %s(db_name("repository")) |
| 1622 | if( g.configOpen ){ |
| 1623 | @ <li>config → %s(db_name("configdb")) |
| 1624 | } |
| 1625 | if( g.localOpen ){ |
| 1626 | @ <li>local-checkout → %s(db_name("localdb")) |
| 1627 | } |
| 1628 | @ </ul></p> |
| 1629 | @ |
| 1630 | @ <form method="post" action="%s(g.zTop)/admin_sql"> |
| 1631 | login_insert_csrf_secret(); |
| 1632 |
+4
-4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -318,11 +318,11 @@ | ||
| 318 | 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | 319 | }else{ |
| 320 | 320 | @ <td class="timelineTableCell"> |
| 321 | 321 | } |
| 322 | 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | - @ • | |
| 323 | + @ • | |
| 324 | 324 | } |
| 325 | 325 | if( zType[0]=='c' ){ |
| 326 | 326 | hyperlink_to_uuid(zUuid); |
| 327 | 327 | if( isLeaf ){ |
| 328 | 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | ||
| 436 | 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | 437 | @ [view]</a></li> |
| 438 | 438 | }else if( isDel ){ |
| 439 | 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | - @ <li> %h(zOldName) → %h(zFilename) | |
| 441 | + @ <li> %h(zOldName) → %h(zFilename) | |
| 442 | 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | 443 | @ [view]</a></li> |
| 444 | 444 | }else{ |
| 445 | 445 | if( zOldName!=0 ){ |
| 446 | - @ <li> %h(zOldName) → %h(zFilename) | |
| 446 | + @ <li> %h(zOldName) → %h(zFilename) | |
| 447 | 447 | }else{ |
| 448 | 448 | @ <li> %h(zFilename) |
| 449 | 449 | } |
| 450 | 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | 451 | @ [diff]</a></li> |
| 452 | 452 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -318,11 +318,11 @@ | |
| 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | }else{ |
| 320 | @ <td class="timelineTableCell"> |
| 321 | } |
| 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | @ • |
| 324 | } |
| 325 | if( zType[0]=='c' ){ |
| 326 | hyperlink_to_uuid(zUuid); |
| 327 | if( isLeaf ){ |
| 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | |
| 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | @ [view]</a></li> |
| 438 | }else if( isDel ){ |
| 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | @ <li> %h(zOldName) → %h(zFilename) |
| 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | @ [view]</a></li> |
| 444 | }else{ |
| 445 | if( zOldName!=0 ){ |
| 446 | @ <li> %h(zOldName) → %h(zFilename) |
| 447 | }else{ |
| 448 | @ <li> %h(zFilename) |
| 449 | } |
| 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | @ [diff]</a></li> |
| 452 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -318,11 +318,11 @@ | |
| 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | }else{ |
| 320 | @ <td class="timelineTableCell"> |
| 321 | } |
| 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | @ • |
| 324 | } |
| 325 | if( zType[0]=='c' ){ |
| 326 | hyperlink_to_uuid(zUuid); |
| 327 | if( isLeaf ){ |
| 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | |
| 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | @ [view]</a></li> |
| 438 | }else if( isDel ){ |
| 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | @ <li> %h(zOldName) → %h(zFilename) |
| 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | @ [view]</a></li> |
| 444 | }else{ |
| 445 | if( zOldName!=0 ){ |
| 446 | @ <li> %h(zOldName) → %h(zFilename) |
| 447 | }else{ |
| 448 | @ <li> %h(zFilename) |
| 449 | } |
| 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | @ [diff]</a></li> |
| 452 |
+4
-4
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -318,11 +318,11 @@ | ||
| 318 | 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | 319 | }else{ |
| 320 | 320 | @ <td class="timelineTableCell"> |
| 321 | 321 | } |
| 322 | 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | - @ • | |
| 323 | + @ • | |
| 324 | 324 | } |
| 325 | 325 | if( zType[0]=='c' ){ |
| 326 | 326 | hyperlink_to_uuid(zUuid); |
| 327 | 327 | if( isLeaf ){ |
| 328 | 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | ||
| 436 | 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | 437 | @ [view]</a></li> |
| 438 | 438 | }else if( isDel ){ |
| 439 | 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | - @ <li> %h(zOldName) → %h(zFilename) | |
| 441 | + @ <li> %h(zOldName) → %h(zFilename) | |
| 442 | 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | 443 | @ [view]</a></li> |
| 444 | 444 | }else{ |
| 445 | 445 | if( zOldName!=0 ){ |
| 446 | - @ <li> %h(zOldName) → %h(zFilename) | |
| 446 | + @ <li> %h(zOldName) → %h(zFilename) | |
| 447 | 447 | }else{ |
| 448 | 448 | @ <li> %h(zFilename) |
| 449 | 449 | } |
| 450 | 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | 451 | @ [diff]</a></li> |
| 452 | 452 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -318,11 +318,11 @@ | |
| 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | }else{ |
| 320 | @ <td class="timelineTableCell"> |
| 321 | } |
| 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | @ • |
| 324 | } |
| 325 | if( zType[0]=='c' ){ |
| 326 | hyperlink_to_uuid(zUuid); |
| 327 | if( isLeaf ){ |
| 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | |
| 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | @ [view]</a></li> |
| 438 | }else if( isDel ){ |
| 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | @ <li> %h(zOldName) → %h(zFilename) |
| 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | @ [view]</a></li> |
| 444 | }else{ |
| 445 | if( zOldName!=0 ){ |
| 446 | @ <li> %h(zOldName) → %h(zFilename) |
| 447 | }else{ |
| 448 | @ <li> %h(zFilename) |
| 449 | } |
| 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | @ [diff]</a></li> |
| 452 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -318,11 +318,11 @@ | |
| 318 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 319 | }else{ |
| 320 | @ <td class="timelineTableCell"> |
| 321 | } |
| 322 | if( pGraph && zType[0]!='c' ){ |
| 323 | @ • |
| 324 | } |
| 325 | if( zType[0]=='c' ){ |
| 326 | hyperlink_to_uuid(zUuid); |
| 327 | if( isLeaf ){ |
| 328 | if( db_exists("SELECT 1 FROM tagxref" |
| @@ -436,16 +436,16 @@ | |
| 436 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 437 | @ [view]</a></li> |
| 438 | }else if( isDel ){ |
| 439 | @ <li> %h(zFilename) (deleted)</li> |
| 440 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 441 | @ <li> %h(zOldName) → %h(zFilename) |
| 442 | @ %z(xhref("target='diffwindow'","%R/artifact/%S",zNew)) |
| 443 | @ [view]</a></li> |
| 444 | }else{ |
| 445 | if( zOldName!=0 ){ |
| 446 | @ <li> %h(zOldName) → %h(zFilename) |
| 447 | }else{ |
| 448 | @ <li> %h(zFilename) |
| 449 | } |
| 450 | @ %z(xhref("target='diffwindow'","%R/fdiff?v1=%S&v2=%S",zOld,zNew)) |
| 451 | @ [diff]</a></li> |
| 452 |
+1
-1
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -90,11 +90,11 @@ | ||
| 90 | 90 | isFirstline = 0; |
| 91 | 91 | } |
| 92 | 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | 93 | if( zLine[i]!='@' ){ |
| 94 | 94 | if( inPrint || inStr ) end_block(out); |
| 95 | - for(j=0; zLine[i]; i++){ | |
| 95 | + for(i=0,j=0; zLine[i]; i++){ | |
| 96 | 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | 98 | j += 5; |
| 99 | 99 | } else { |
| 100 | 100 | zOut[j++] = zLine[i]; |
| 101 | 101 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -90,11 +90,11 @@ | |
| 90 | isFirstline = 0; |
| 91 | } |
| 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | if( zLine[i]!='@' ){ |
| 94 | if( inPrint || inStr ) end_block(out); |
| 95 | for(j=0; zLine[i]; i++){ |
| 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | j += 5; |
| 99 | } else { |
| 100 | zOut[j++] = zLine[i]; |
| 101 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -90,11 +90,11 @@ | |
| 90 | isFirstline = 0; |
| 91 | } |
| 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | if( zLine[i]!='@' ){ |
| 94 | if( inPrint || inStr ) end_block(out); |
| 95 | for(i=0,j=0; zLine[i]; i++){ |
| 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | j += 5; |
| 99 | } else { |
| 100 | zOut[j++] = zLine[i]; |
| 101 |
+1
-1
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -90,11 +90,11 @@ | ||
| 90 | 90 | isFirstline = 0; |
| 91 | 91 | } |
| 92 | 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | 93 | if( zLine[i]!='@' ){ |
| 94 | 94 | if( inPrint || inStr ) end_block(out); |
| 95 | - for(j=0; zLine[i]; i++){ | |
| 95 | + for(i=0,j=0; zLine[i]; i++){ | |
| 96 | 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | 98 | j += 5; |
| 99 | 99 | } else { |
| 100 | 100 | zOut[j++] = zLine[i]; |
| 101 | 101 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -90,11 +90,11 @@ | |
| 90 | isFirstline = 0; |
| 91 | } |
| 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | if( zLine[i]!='@' ){ |
| 94 | if( inPrint || inStr ) end_block(out); |
| 95 | for(j=0; zLine[i]; i++){ |
| 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | j += 5; |
| 99 | } else { |
| 100 | zOut[j++] = zLine[i]; |
| 101 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -90,11 +90,11 @@ | |
| 90 | isFirstline = 0; |
| 91 | } |
| 92 | for(i=0; zLine[i] && isspace(zLine[i]); i++){} |
| 93 | if( zLine[i]!='@' ){ |
| 94 | if( inPrint || inStr ) end_block(out); |
| 95 | for(i=0,j=0; zLine[i]; i++){ |
| 96 | if (128 <= (unsigned char)zLine[i]) { |
| 97 | sprintf(&zOut[j], "\\0x%.2X", zLine[i] & 0xFF); |
| 98 | j += 5; |
| 99 | } else { |
| 100 | zOut[j++] = zLine[i]; |
| 101 |
+17
-8
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -25,10 +25,19 @@ | ||
| 25 | 25 | #include "dirent.h" |
| 26 | 26 | #else |
| 27 | 27 | #include <dirent.h> |
| 28 | 28 | #endif |
| 29 | 29 | |
| 30 | +#ifndef _WIN32 | |
| 31 | +#define _WDIR DIR | |
| 32 | +#define _wdirent dirent | |
| 33 | +#define _wopendir opendir | |
| 34 | +#define _wreaddir readdir | |
| 35 | +#define _wclosedir closedir | |
| 36 | +#define wchar_t char | |
| 37 | +#endif | |
| 38 | + | |
| 30 | 39 | /* |
| 31 | 40 | ** The input is guaranteed to be a 40-character well-formed UUID. |
| 32 | 41 | ** Find its rid. |
| 33 | 42 | */ |
| 34 | 43 | int fast_uuid_to_rid(const char *zUuid){ |
| @@ -381,18 +390,18 @@ | ||
| 381 | 390 | ** Any files or directories that match the glob pattern pIgnore are |
| 382 | 391 | ** excluded from the scan. Name matching occurs after the first |
| 383 | 392 | ** nPrefix characters are elided from the filename. |
| 384 | 393 | */ |
| 385 | 394 | void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){ |
| 386 | - DIR *d; | |
| 395 | + _WDIR *d; | |
| 387 | 396 | int origSize; |
| 388 | 397 | const char *zDir; |
| 389 | - struct dirent *pEntry; | |
| 398 | + struct _wdirent *pEntry; | |
| 390 | 399 | int skipAll = 0; |
| 391 | 400 | static Stmt ins; |
| 392 | 401 | static int depth = 0; |
| 393 | - char *zMbcs; | |
| 402 | + wchar_t *zMbcs; | |
| 394 | 403 | |
| 395 | 404 | origSize = blob_size(pPath); |
| 396 | 405 | if( pIgnore ){ |
| 397 | 406 | blob_appendf(pPath, "/"); |
| 398 | 407 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| @@ -407,22 +416,22 @@ | ||
| 407 | 416 | ); |
| 408 | 417 | } |
| 409 | 418 | depth++; |
| 410 | 419 | |
| 411 | 420 | zDir = blob_str(pPath); |
| 412 | - zMbcs = fossil_utf8_to_mbcs(zDir); | |
| 413 | - d = opendir(zMbcs); | |
| 421 | + zMbcs = fossil_utf8_to_unicode(zDir); | |
| 422 | + d = _wopendir(zMbcs); | |
| 414 | 423 | if( d ){ |
| 415 | - while( (pEntry=readdir(d))!=0 ){ | |
| 424 | + while( (pEntry=_wreaddir(d))!=0 ){ | |
| 416 | 425 | char *zPath; |
| 417 | 426 | char *zUtf8; |
| 418 | 427 | if( pEntry->d_name[0]=='.' ){ |
| 419 | 428 | if( !allFlag ) continue; |
| 420 | 429 | if( pEntry->d_name[1]==0 ) continue; |
| 421 | 430 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 422 | 431 | } |
| 423 | - zUtf8 = fossil_mbcs_to_utf8(pEntry->d_name); | |
| 432 | + zUtf8 = fossil_unicode_to_utf8(pEntry->d_name); | |
| 424 | 433 | blob_appendf(pPath, "/%s", zUtf8); |
| 425 | 434 | fossil_mbcs_free(zUtf8); |
| 426 | 435 | zPath = blob_str(pPath); |
| 427 | 436 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 428 | 437 | /* do nothing */ |
| @@ -435,11 +444,11 @@ | ||
| 435 | 444 | db_step(&ins); |
| 436 | 445 | db_reset(&ins); |
| 437 | 446 | } |
| 438 | 447 | blob_resize(pPath, origSize); |
| 439 | 448 | } |
| 440 | - closedir(d); | |
| 449 | + _wclosedir(d); | |
| 441 | 450 | } |
| 442 | 451 | fossil_mbcs_free(zMbcs); |
| 443 | 452 | |
| 444 | 453 | depth--; |
| 445 | 454 | if( depth==0 ){ |
| 446 | 455 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -25,10 +25,19 @@ | |
| 25 | #include "dirent.h" |
| 26 | #else |
| 27 | #include <dirent.h> |
| 28 | #endif |
| 29 | |
| 30 | /* |
| 31 | ** The input is guaranteed to be a 40-character well-formed UUID. |
| 32 | ** Find its rid. |
| 33 | */ |
| 34 | int fast_uuid_to_rid(const char *zUuid){ |
| @@ -381,18 +390,18 @@ | |
| 381 | ** Any files or directories that match the glob pattern pIgnore are |
| 382 | ** excluded from the scan. Name matching occurs after the first |
| 383 | ** nPrefix characters are elided from the filename. |
| 384 | */ |
| 385 | void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){ |
| 386 | DIR *d; |
| 387 | int origSize; |
| 388 | const char *zDir; |
| 389 | struct dirent *pEntry; |
| 390 | int skipAll = 0; |
| 391 | static Stmt ins; |
| 392 | static int depth = 0; |
| 393 | char *zMbcs; |
| 394 | |
| 395 | origSize = blob_size(pPath); |
| 396 | if( pIgnore ){ |
| 397 | blob_appendf(pPath, "/"); |
| 398 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| @@ -407,22 +416,22 @@ | |
| 407 | ); |
| 408 | } |
| 409 | depth++; |
| 410 | |
| 411 | zDir = blob_str(pPath); |
| 412 | zMbcs = fossil_utf8_to_mbcs(zDir); |
| 413 | d = opendir(zMbcs); |
| 414 | if( d ){ |
| 415 | while( (pEntry=readdir(d))!=0 ){ |
| 416 | char *zPath; |
| 417 | char *zUtf8; |
| 418 | if( pEntry->d_name[0]=='.' ){ |
| 419 | if( !allFlag ) continue; |
| 420 | if( pEntry->d_name[1]==0 ) continue; |
| 421 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 422 | } |
| 423 | zUtf8 = fossil_mbcs_to_utf8(pEntry->d_name); |
| 424 | blob_appendf(pPath, "/%s", zUtf8); |
| 425 | fossil_mbcs_free(zUtf8); |
| 426 | zPath = blob_str(pPath); |
| 427 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 428 | /* do nothing */ |
| @@ -435,11 +444,11 @@ | |
| 435 | db_step(&ins); |
| 436 | db_reset(&ins); |
| 437 | } |
| 438 | blob_resize(pPath, origSize); |
| 439 | } |
| 440 | closedir(d); |
| 441 | } |
| 442 | fossil_mbcs_free(zMbcs); |
| 443 | |
| 444 | depth--; |
| 445 | if( depth==0 ){ |
| 446 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -25,10 +25,19 @@ | |
| 25 | #include "dirent.h" |
| 26 | #else |
| 27 | #include <dirent.h> |
| 28 | #endif |
| 29 | |
| 30 | #ifndef _WIN32 |
| 31 | #define _WDIR DIR |
| 32 | #define _wdirent dirent |
| 33 | #define _wopendir opendir |
| 34 | #define _wreaddir readdir |
| 35 | #define _wclosedir closedir |
| 36 | #define wchar_t char |
| 37 | #endif |
| 38 | |
| 39 | /* |
| 40 | ** The input is guaranteed to be a 40-character well-formed UUID. |
| 41 | ** Find its rid. |
| 42 | */ |
| 43 | int fast_uuid_to_rid(const char *zUuid){ |
| @@ -381,18 +390,18 @@ | |
| 390 | ** Any files or directories that match the glob pattern pIgnore are |
| 391 | ** excluded from the scan. Name matching occurs after the first |
| 392 | ** nPrefix characters are elided from the filename. |
| 393 | */ |
| 394 | void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){ |
| 395 | _WDIR *d; |
| 396 | int origSize; |
| 397 | const char *zDir; |
| 398 | struct _wdirent *pEntry; |
| 399 | int skipAll = 0; |
| 400 | static Stmt ins; |
| 401 | static int depth = 0; |
| 402 | wchar_t *zMbcs; |
| 403 | |
| 404 | origSize = blob_size(pPath); |
| 405 | if( pIgnore ){ |
| 406 | blob_appendf(pPath, "/"); |
| 407 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| @@ -407,22 +416,22 @@ | |
| 416 | ); |
| 417 | } |
| 418 | depth++; |
| 419 | |
| 420 | zDir = blob_str(pPath); |
| 421 | zMbcs = fossil_utf8_to_unicode(zDir); |
| 422 | d = _wopendir(zMbcs); |
| 423 | if( d ){ |
| 424 | while( (pEntry=_wreaddir(d))!=0 ){ |
| 425 | char *zPath; |
| 426 | char *zUtf8; |
| 427 | if( pEntry->d_name[0]=='.' ){ |
| 428 | if( !allFlag ) continue; |
| 429 | if( pEntry->d_name[1]==0 ) continue; |
| 430 | if( pEntry->d_name[1]=='.' && pEntry->d_name[2]==0 ) continue; |
| 431 | } |
| 432 | zUtf8 = fossil_unicode_to_utf8(pEntry->d_name); |
| 433 | blob_appendf(pPath, "/%s", zUtf8); |
| 434 | fossil_mbcs_free(zUtf8); |
| 435 | zPath = blob_str(pPath); |
| 436 | if( glob_match(pIgnore, &zPath[nPrefix+1]) ){ |
| 437 | /* do nothing */ |
| @@ -435,11 +444,11 @@ | |
| 444 | db_step(&ins); |
| 445 | db_reset(&ins); |
| 446 | } |
| 447 | blob_resize(pPath, origSize); |
| 448 | } |
| 449 | _wclosedir(d); |
| 450 | } |
| 451 | fossil_mbcs_free(zMbcs); |
| 452 | |
| 453 | depth--; |
| 454 | if( depth==0 ){ |
| 455 |
+10
-10
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -1079,20 +1079,20 @@ | ||
| 1079 | 1079 | */ |
| 1080 | 1080 | if( isClosed ){ |
| 1081 | 1081 | if( g.perm.Hyperlink ){ |
| 1082 | 1082 | blob_appendf(p->pOut, |
| 1083 | 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | - href("info/%s",zTarget) | |
| 1084 | + href("%R/info/%s",zTarget) | |
| 1085 | 1085 | ); |
| 1086 | 1086 | zTerm = "]</span></a>"; |
| 1087 | 1087 | }else{ |
| 1088 | 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | 1089 | zTerm = "]</span>"; |
| 1090 | 1090 | } |
| 1091 | 1091 | }else{ |
| 1092 | 1092 | if( g.perm.Hyperlink ){ |
| 1093 | - blob_appendf(p->pOut,"%z[", href("info/%s", zTarget)); | |
| 1093 | + blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget)); | |
| 1094 | 1094 | zTerm = "]</a>"; |
| 1095 | 1095 | }else{ |
| 1096 | 1096 | blob_appendf(p->pOut, "["); |
| 1097 | 1097 | zTerm = "]"; |
| 1098 | 1098 | } |
| @@ -1099,22 +1099,22 @@ | ||
| 1099 | 1099 | } |
| 1100 | 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | 1102 | zTerm = "]</span>"; |
| 1103 | 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | - blob_appendf(p->pOut, "%z[",href("info/%s", zTarget)); | |
| 1104 | + blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget)); | |
| 1105 | 1105 | zTerm = "]</a>"; |
| 1106 | 1106 | } |
| 1107 | 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | - blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget); | |
| 1109 | + blob_appendf(p->pOut, "<a href=\"%R/timeline?c=%T\">", zTarget); | |
| 1110 | 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | 1112 | zTarget += 5; |
| 1113 | - blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); | |
| 1113 | + blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); | |
| 1114 | 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | - blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); | |
| 1115 | + blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); | |
| 1116 | 1116 | }else{ |
| 1117 | 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | 1118 | zTerm = ""; |
| 1119 | 1119 | } |
| 1120 | 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | ||
| 1190 | 1190 | p->state |= AT_NEWLINE; |
| 1191 | 1191 | break; |
| 1192 | 1192 | } |
| 1193 | 1193 | case TOKEN_BUL_LI: { |
| 1194 | 1194 | if( inlineOnly ){ |
| 1195 | - blob_append(p->pOut, " • ", -1); | |
| 1195 | + blob_append(p->pOut, " • ", -1); | |
| 1196 | 1196 | }else{ |
| 1197 | 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | 1198 | if( p->wikiList ){ |
| 1199 | 1199 | popStackToTag(p, p->wikiList); |
| 1200 | 1200 | } |
| @@ -1410,18 +1410,18 @@ | ||
| 1410 | 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | - blob_appendf(p->pOut, "<pre name='code' class='%s'>", | |
| 1415 | + blob_appendf(p->pOut, "<pre name=\"code\" class=\"%s\">", | |
| 1416 | 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | 1417 | vAttrDidAppend=1; |
| 1418 | 1418 | } |
| 1419 | 1419 | } |
| 1420 | 1420 | if( !vAttrDidAppend ) { |
| 1421 | 1421 | endAutoParagraph(p); |
| 1422 | - blob_append(p->pOut, "<pre class='verbatim'>",-1); | |
| 1422 | + blob_append(p->pOut, "<pre class=\"verbatim\">",-1); | |
| 1423 | 1423 | } |
| 1424 | 1424 | p->wantAutoParagraph = 0; |
| 1425 | 1425 | }else |
| 1426 | 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 | 1428 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -1079,20 +1079,20 @@ | |
| 1079 | */ |
| 1080 | if( isClosed ){ |
| 1081 | if( g.perm.Hyperlink ){ |
| 1082 | blob_appendf(p->pOut, |
| 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | href("info/%s",zTarget) |
| 1085 | ); |
| 1086 | zTerm = "]</span></a>"; |
| 1087 | }else{ |
| 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | zTerm = "]</span>"; |
| 1090 | } |
| 1091 | }else{ |
| 1092 | if( g.perm.Hyperlink ){ |
| 1093 | blob_appendf(p->pOut,"%z[", href("info/%s", zTarget)); |
| 1094 | zTerm = "]</a>"; |
| 1095 | }else{ |
| 1096 | blob_appendf(p->pOut, "["); |
| 1097 | zTerm = "]"; |
| 1098 | } |
| @@ -1099,22 +1099,22 @@ | |
| 1099 | } |
| 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | zTerm = "]</span>"; |
| 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | blob_appendf(p->pOut, "%z[",href("info/%s", zTarget)); |
| 1105 | zTerm = "]</a>"; |
| 1106 | } |
| 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget); |
| 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | zTarget += 5; |
| 1113 | blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); |
| 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); |
| 1116 | }else{ |
| 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | zTerm = ""; |
| 1119 | } |
| 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | |
| 1190 | p->state |= AT_NEWLINE; |
| 1191 | break; |
| 1192 | } |
| 1193 | case TOKEN_BUL_LI: { |
| 1194 | if( inlineOnly ){ |
| 1195 | blob_append(p->pOut, " • ", -1); |
| 1196 | }else{ |
| 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | if( p->wikiList ){ |
| 1199 | popStackToTag(p, p->wikiList); |
| 1200 | } |
| @@ -1410,18 +1410,18 @@ | |
| 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | blob_appendf(p->pOut, "<pre name='code' class='%s'>", |
| 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | vAttrDidAppend=1; |
| 1418 | } |
| 1419 | } |
| 1420 | if( !vAttrDidAppend ) { |
| 1421 | endAutoParagraph(p); |
| 1422 | blob_append(p->pOut, "<pre class='verbatim'>",-1); |
| 1423 | } |
| 1424 | p->wantAutoParagraph = 0; |
| 1425 | }else |
| 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -1079,20 +1079,20 @@ | |
| 1079 | */ |
| 1080 | if( isClosed ){ |
| 1081 | if( g.perm.Hyperlink ){ |
| 1082 | blob_appendf(p->pOut, |
| 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | href("%R/info/%s",zTarget) |
| 1085 | ); |
| 1086 | zTerm = "]</span></a>"; |
| 1087 | }else{ |
| 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | zTerm = "]</span>"; |
| 1090 | } |
| 1091 | }else{ |
| 1092 | if( g.perm.Hyperlink ){ |
| 1093 | blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget)); |
| 1094 | zTerm = "]</a>"; |
| 1095 | }else{ |
| 1096 | blob_appendf(p->pOut, "["); |
| 1097 | zTerm = "]"; |
| 1098 | } |
| @@ -1099,22 +1099,22 @@ | |
| 1099 | } |
| 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | zTerm = "]</span>"; |
| 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget)); |
| 1105 | zTerm = "]</a>"; |
| 1106 | } |
| 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | blob_appendf(p->pOut, "<a href=\"%R/timeline?c=%T\">", zTarget); |
| 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | zTarget += 5; |
| 1113 | blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); |
| 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); |
| 1116 | }else{ |
| 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | zTerm = ""; |
| 1119 | } |
| 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | |
| 1190 | p->state |= AT_NEWLINE; |
| 1191 | break; |
| 1192 | } |
| 1193 | case TOKEN_BUL_LI: { |
| 1194 | if( inlineOnly ){ |
| 1195 | blob_append(p->pOut, " • ", -1); |
| 1196 | }else{ |
| 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | if( p->wikiList ){ |
| 1199 | popStackToTag(p, p->wikiList); |
| 1200 | } |
| @@ -1410,18 +1410,18 @@ | |
| 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | blob_appendf(p->pOut, "<pre name=\"code\" class=\"%s\">", |
| 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | vAttrDidAppend=1; |
| 1418 | } |
| 1419 | } |
| 1420 | if( !vAttrDidAppend ) { |
| 1421 | endAutoParagraph(p); |
| 1422 | blob_append(p->pOut, "<pre class=\"verbatim\">",-1); |
| 1423 | } |
| 1424 | p->wantAutoParagraph = 0; |
| 1425 | }else |
| 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 |
+10
-10
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | -** Copyright (c) 2007 D. Richard Hipp | |
| 2 | +** Copyright © 2007 D. Richard Hipp | |
| 3 | 3 | ** |
| 4 | 4 | ** This program is free software; you can redistribute it and/or |
| 5 | 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | 7 | |
| @@ -1079,20 +1079,20 @@ | ||
| 1079 | 1079 | */ |
| 1080 | 1080 | if( isClosed ){ |
| 1081 | 1081 | if( g.perm.Hyperlink ){ |
| 1082 | 1082 | blob_appendf(p->pOut, |
| 1083 | 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | - href("info/%s",zTarget) | |
| 1084 | + href("%R/info/%s",zTarget) | |
| 1085 | 1085 | ); |
| 1086 | 1086 | zTerm = "]</span></a>"; |
| 1087 | 1087 | }else{ |
| 1088 | 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | 1089 | zTerm = "]</span>"; |
| 1090 | 1090 | } |
| 1091 | 1091 | }else{ |
| 1092 | 1092 | if( g.perm.Hyperlink ){ |
| 1093 | - blob_appendf(p->pOut,"%z[", href("info/%s", zTarget)); | |
| 1093 | + blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget)); | |
| 1094 | 1094 | zTerm = "]</a>"; |
| 1095 | 1095 | }else{ |
| 1096 | 1096 | blob_appendf(p->pOut, "["); |
| 1097 | 1097 | zTerm = "]"; |
| 1098 | 1098 | } |
| @@ -1099,22 +1099,22 @@ | ||
| 1099 | 1099 | } |
| 1100 | 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | 1102 | zTerm = "]</span>"; |
| 1103 | 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | - blob_appendf(p->pOut, "%z[",href("info/%s", zTarget)); | |
| 1104 | + blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget)); | |
| 1105 | 1105 | zTerm = "]</a>"; |
| 1106 | 1106 | } |
| 1107 | 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | - blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget); | |
| 1109 | + blob_appendf(p->pOut, "<a href=\"%R/timeline?c=%T\">", zTarget); | |
| 1110 | 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | 1112 | zTarget += 5; |
| 1113 | - blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); | |
| 1113 | + blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); | |
| 1114 | 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | - blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); | |
| 1115 | + blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); | |
| 1116 | 1116 | }else{ |
| 1117 | 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | 1118 | zTerm = ""; |
| 1119 | 1119 | } |
| 1120 | 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | ||
| 1190 | 1190 | p->state |= AT_NEWLINE; |
| 1191 | 1191 | break; |
| 1192 | 1192 | } |
| 1193 | 1193 | case TOKEN_BUL_LI: { |
| 1194 | 1194 | if( inlineOnly ){ |
| 1195 | - blob_append(p->pOut, " • ", -1); | |
| 1195 | + blob_append(p->pOut, " • ", -1); | |
| 1196 | 1196 | }else{ |
| 1197 | 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | 1198 | if( p->wikiList ){ |
| 1199 | 1199 | popStackToTag(p, p->wikiList); |
| 1200 | 1200 | } |
| @@ -1410,18 +1410,18 @@ | ||
| 1410 | 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | - blob_appendf(p->pOut, "<pre name='code' class='%s'>", | |
| 1415 | + blob_appendf(p->pOut, "<pre name=\"code\" class=\"%s\">", | |
| 1416 | 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | 1417 | vAttrDidAppend=1; |
| 1418 | 1418 | } |
| 1419 | 1419 | } |
| 1420 | 1420 | if( !vAttrDidAppend ) { |
| 1421 | 1421 | endAutoParagraph(p); |
| 1422 | - blob_append(p->pOut, "<pre class='verbatim'>",-1); | |
| 1422 | + blob_append(p->pOut, "<pre class=\"verbatim\">",-1); | |
| 1423 | 1423 | } |
| 1424 | 1424 | p->wantAutoParagraph = 0; |
| 1425 | 1425 | }else |
| 1426 | 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 | 1428 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright (c) 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -1079,20 +1079,20 @@ | |
| 1079 | */ |
| 1080 | if( isClosed ){ |
| 1081 | if( g.perm.Hyperlink ){ |
| 1082 | blob_appendf(p->pOut, |
| 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | href("info/%s",zTarget) |
| 1085 | ); |
| 1086 | zTerm = "]</span></a>"; |
| 1087 | }else{ |
| 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | zTerm = "]</span>"; |
| 1090 | } |
| 1091 | }else{ |
| 1092 | if( g.perm.Hyperlink ){ |
| 1093 | blob_appendf(p->pOut,"%z[", href("info/%s", zTarget)); |
| 1094 | zTerm = "]</a>"; |
| 1095 | }else{ |
| 1096 | blob_appendf(p->pOut, "["); |
| 1097 | zTerm = "]"; |
| 1098 | } |
| @@ -1099,22 +1099,22 @@ | |
| 1099 | } |
| 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | zTerm = "]</span>"; |
| 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | blob_appendf(p->pOut, "%z[",href("info/%s", zTarget)); |
| 1105 | zTerm = "]</a>"; |
| 1106 | } |
| 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | blob_appendf(p->pOut, "<a href=\"timeline?c=%T\">", zTarget); |
| 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | zTarget += 5; |
| 1113 | blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); |
| 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | blob_appendf(p->pOut, "<a href=\"wiki?name=%T\">", zTarget); |
| 1116 | }else{ |
| 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | zTerm = ""; |
| 1119 | } |
| 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | |
| 1190 | p->state |= AT_NEWLINE; |
| 1191 | break; |
| 1192 | } |
| 1193 | case TOKEN_BUL_LI: { |
| 1194 | if( inlineOnly ){ |
| 1195 | blob_append(p->pOut, " • ", -1); |
| 1196 | }else{ |
| 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | if( p->wikiList ){ |
| 1199 | popStackToTag(p, p->wikiList); |
| 1200 | } |
| @@ -1410,18 +1410,18 @@ | |
| 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | blob_appendf(p->pOut, "<pre name='code' class='%s'>", |
| 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | vAttrDidAppend=1; |
| 1418 | } |
| 1419 | } |
| 1420 | if( !vAttrDidAppend ) { |
| 1421 | endAutoParagraph(p); |
| 1422 | blob_append(p->pOut, "<pre class='verbatim'>",-1); |
| 1423 | } |
| 1424 | p->wantAutoParagraph = 0; |
| 1425 | }else |
| 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1,7 +1,7 @@ | |
| 1 | /* |
| 2 | ** Copyright © 2007 D. Richard Hipp |
| 3 | ** |
| 4 | ** This program is free software; you can redistribute it and/or |
| 5 | ** modify it under the terms of the Simplified BSD License (also |
| 6 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 7 | |
| @@ -1079,20 +1079,20 @@ | |
| 1079 | */ |
| 1080 | if( isClosed ){ |
| 1081 | if( g.perm.Hyperlink ){ |
| 1082 | blob_appendf(p->pOut, |
| 1083 | "%z<span class=\"wikiTagCancelled\">[", |
| 1084 | href("%R/info/%s",zTarget) |
| 1085 | ); |
| 1086 | zTerm = "]</span></a>"; |
| 1087 | }else{ |
| 1088 | blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">["); |
| 1089 | zTerm = "]</span>"; |
| 1090 | } |
| 1091 | }else{ |
| 1092 | if( g.perm.Hyperlink ){ |
| 1093 | blob_appendf(p->pOut,"%z[", href("%R/info/%s", zTarget)); |
| 1094 | zTerm = "]</a>"; |
| 1095 | }else{ |
| 1096 | blob_appendf(p->pOut, "["); |
| 1097 | zTerm = "]"; |
| 1098 | } |
| @@ -1099,22 +1099,22 @@ | |
| 1099 | } |
| 1100 | }else if( !in_this_repo(zTarget) ){ |
| 1101 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[", zTarget); |
| 1102 | zTerm = "]</span>"; |
| 1103 | }else if( g.perm.Hyperlink ){ |
| 1104 | blob_appendf(p->pOut, "%z[",href("%R/info/%s", zTarget)); |
| 1105 | zTerm = "]</a>"; |
| 1106 | } |
| 1107 | }else if( strlen(zTarget)>=10 && fossil_isdigit(zTarget[0]) && zTarget[4]=='-' |
| 1108 | && db_int(0, "SELECT datetime(%Q) NOT NULL", zTarget) ){ |
| 1109 | blob_appendf(p->pOut, "<a href=\"%R/timeline?c=%T\">", zTarget); |
| 1110 | }else if( strncmp(zTarget, "wiki:", 5)==0 |
| 1111 | && wiki_name_is_wellformed((const unsigned char*)zTarget) ){ |
| 1112 | zTarget += 5; |
| 1113 | blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); |
| 1114 | }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){ |
| 1115 | blob_appendf(p->pOut, "<a href=\"%R/wiki?name=%T\">", zTarget); |
| 1116 | }else{ |
| 1117 | blob_appendf(p->pOut, "<span class=\"brokenlink\">[%h]</span>", zTarget); |
| 1118 | zTerm = ""; |
| 1119 | } |
| 1120 | assert( strlen(zTerm)<nClose ); |
| @@ -1190,11 +1190,11 @@ | |
| 1190 | p->state |= AT_NEWLINE; |
| 1191 | break; |
| 1192 | } |
| 1193 | case TOKEN_BUL_LI: { |
| 1194 | if( inlineOnly ){ |
| 1195 | blob_append(p->pOut, " • ", -1); |
| 1196 | }else{ |
| 1197 | if( p->wikiList!=MARKUP_UL ){ |
| 1198 | if( p->wikiList ){ |
| 1199 | popStackToTag(p, p->wikiList); |
| 1200 | } |
| @@ -1410,18 +1410,18 @@ | |
| 1410 | p->state &= ~ALLOW_WIKI; |
| 1411 | for (vAttrIdx = 0; vAttrIdx < markup.nAttr; vAttrIdx++){ |
| 1412 | if( markup.aAttr[vAttrIdx].iACode == ATTR_ID ){ |
| 1413 | p->zVerbatimId = markup.aAttr[0].zValue; |
| 1414 | }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){ |
| 1415 | blob_appendf(p->pOut, "<pre name=\"code\" class=\"%s\">", |
| 1416 | markup.aAttr[vAttrIdx].zValue); |
| 1417 | vAttrDidAppend=1; |
| 1418 | } |
| 1419 | } |
| 1420 | if( !vAttrDidAppend ) { |
| 1421 | endAutoParagraph(p); |
| 1422 | blob_append(p->pOut, "<pre class=\"verbatim\">",-1); |
| 1423 | } |
| 1424 | p->wantAutoParagraph = 0; |
| 1425 | }else |
| 1426 | if( markup.iType==MUTYPE_LI ){ |
| 1427 | if( backupToType(p, MUTYPE_LIST)==0 ){ |
| 1428 |