Fossil SCM
Catch up with recent changes on trunk.
Commit
991f4b98f65221379cc42bb08493053e1d4bc31b
Parent
c8a249205ef5b60…
10 files changed
+1
-1
-4
+12
-5
+11
-10
+5
-5
+5
-5
+16
-24
+3
-1
+3
+3
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -838,11 +838,11 @@ | ||
| 838 | 838 | #if defined(_WIN32) |
| 839 | 839 | fflush(stdout); |
| 840 | 840 | _setmode(_fileno(stdout), _O_TEXT); |
| 841 | 841 | #endif |
| 842 | 842 | }else{ |
| 843 | - file_mkfolder(zFilename, 1); | |
| 843 | + file_mkfolder(zFilename, 1, 0); | |
| 844 | 844 | out = fossil_fopen(zFilename, "wb"); |
| 845 | 845 | if( out==0 ){ |
| 846 | 846 | fossil_fatal_recursive("unable to open file \"%s\" for writing", |
| 847 | 847 | zFilename); |
| 848 | 848 | return 0; |
| 849 | 849 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -838,11 +838,11 @@ | |
| 838 | #if defined(_WIN32) |
| 839 | fflush(stdout); |
| 840 | _setmode(_fileno(stdout), _O_TEXT); |
| 841 | #endif |
| 842 | }else{ |
| 843 | file_mkfolder(zFilename, 1); |
| 844 | out = fossil_fopen(zFilename, "wb"); |
| 845 | if( out==0 ){ |
| 846 | fossil_fatal_recursive("unable to open file \"%s\" for writing", |
| 847 | zFilename); |
| 848 | return 0; |
| 849 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -838,11 +838,11 @@ | |
| 838 | #if defined(_WIN32) |
| 839 | fflush(stdout); |
| 840 | _setmode(_fileno(stdout), _O_TEXT); |
| 841 | #endif |
| 842 | }else{ |
| 843 | file_mkfolder(zFilename, 1, 0); |
| 844 | out = fossil_fopen(zFilename, "wb"); |
| 845 | if( out==0 ){ |
| 846 | fossil_fatal_recursive("unable to open file \"%s\" for writing", |
| 847 | zFilename); |
| 848 | return 0; |
| 849 |
M
src/db.c
-4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2217,12 +2217,10 @@ | ||
| 2217 | 2217 | void cmd_open(void){ |
| 2218 | 2218 | int emptyFlag; |
| 2219 | 2219 | int keepFlag; |
| 2220 | 2220 | int forceMissingFlag; |
| 2221 | 2221 | int allowNested; |
| 2222 | - char **oldArgv; | |
| 2223 | - int oldArgc; | |
| 2224 | 2222 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 }; |
| 2225 | 2223 | |
| 2226 | 2224 | url_proxy_options(); |
| 2227 | 2225 | emptyFlag = find_option("empty",0,0)!=0; |
| 2228 | 2226 | keepFlag = find_option("keep",0,0)!=0; |
| @@ -2268,12 +2266,10 @@ | ||
| 2268 | 2266 | db_delete_on_failure(LOCALDB_NAME); |
| 2269 | 2267 | db_open_local(0); |
| 2270 | 2268 | db_lset("repository", g.argv[2]); |
| 2271 | 2269 | db_record_repository_filename(g.argv[2]); |
| 2272 | 2270 | db_lset_int("checkout", 0); |
| 2273 | - oldArgv = g.argv; | |
| 2274 | - oldArgc = g.argc; | |
| 2275 | 2271 | azNewArgv[0] = g.argv[0]; |
| 2276 | 2272 | g.argv = azNewArgv; |
| 2277 | 2273 | if( !emptyFlag ){ |
| 2278 | 2274 | g.argc = 3; |
| 2279 | 2275 | if( g.zOpenRevision ){ |
| 2280 | 2276 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2217,12 +2217,10 @@ | |
| 2217 | void cmd_open(void){ |
| 2218 | int emptyFlag; |
| 2219 | int keepFlag; |
| 2220 | int forceMissingFlag; |
| 2221 | int allowNested; |
| 2222 | char **oldArgv; |
| 2223 | int oldArgc; |
| 2224 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 }; |
| 2225 | |
| 2226 | url_proxy_options(); |
| 2227 | emptyFlag = find_option("empty",0,0)!=0; |
| 2228 | keepFlag = find_option("keep",0,0)!=0; |
| @@ -2268,12 +2266,10 @@ | |
| 2268 | db_delete_on_failure(LOCALDB_NAME); |
| 2269 | db_open_local(0); |
| 2270 | db_lset("repository", g.argv[2]); |
| 2271 | db_record_repository_filename(g.argv[2]); |
| 2272 | db_lset_int("checkout", 0); |
| 2273 | oldArgv = g.argv; |
| 2274 | oldArgc = g.argc; |
| 2275 | azNewArgv[0] = g.argv[0]; |
| 2276 | g.argv = azNewArgv; |
| 2277 | if( !emptyFlag ){ |
| 2278 | g.argc = 3; |
| 2279 | if( g.zOpenRevision ){ |
| 2280 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2217,12 +2217,10 @@ | |
| 2217 | void cmd_open(void){ |
| 2218 | int emptyFlag; |
| 2219 | int keepFlag; |
| 2220 | int forceMissingFlag; |
| 2221 | int allowNested; |
| 2222 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0, 0 }; |
| 2223 | |
| 2224 | url_proxy_options(); |
| 2225 | emptyFlag = find_option("empty",0,0)!=0; |
| 2226 | keepFlag = find_option("keep",0,0)!=0; |
| @@ -2268,12 +2266,10 @@ | |
| 2266 | db_delete_on_failure(LOCALDB_NAME); |
| 2267 | db_open_local(0); |
| 2268 | db_lset("repository", g.argv[2]); |
| 2269 | db_record_repository_filename(g.argv[2]); |
| 2270 | db_lset_int("checkout", 0); |
| 2271 | azNewArgv[0] = g.argv[0]; |
| 2272 | g.argv = azNewArgv; |
| 2273 | if( !emptyFlag ){ |
| 2274 | g.argc = 3; |
| 2275 | if( g.zOpenRevision ){ |
| 2276 |
+12
-5
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -386,11 +386,11 @@ | ||
| 386 | 386 | FILE *in, *out; |
| 387 | 387 | int got; |
| 388 | 388 | char zBuf[8192]; |
| 389 | 389 | in = fossil_fopen(zFrom, "rb"); |
| 390 | 390 | if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom); |
| 391 | - file_mkfolder(zTo, 0); | |
| 391 | + file_mkfolder(zTo, 0, 0); | |
| 392 | 392 | out = fossil_fopen(zTo, "wb"); |
| 393 | 393 | if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo); |
| 394 | 394 | while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){ |
| 395 | 395 | fwrite(zBuf, 1, got, out); |
| 396 | 396 | } |
| @@ -530,13 +530,16 @@ | ||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /* |
| 533 | 533 | ** Create the tree of directories in which zFilename belongs, if that sequence |
| 534 | 534 | ** of directories does not already exist. |
| 535 | +** | |
| 536 | +** On success, return zero. On error, return errorReturn if positive, otherwise | |
| 537 | +** print an error message and abort. | |
| 535 | 538 | */ |
| 536 | -void file_mkfolder(const char *zFilename, int forceFlag){ | |
| 537 | - int i, nName; | |
| 539 | +int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){ | |
| 540 | + int i, nName, rc = 0; | |
| 538 | 541 | char *zName; |
| 539 | 542 | |
| 540 | 543 | nName = strlen(zFilename); |
| 541 | 544 | zName = mprintf("%s", zFilename); |
| 542 | 545 | nName = file_simplify_name(zName, nName, 0); |
| @@ -550,20 +553,24 @@ | ||
| 550 | 553 | ** C: in this example. |
| 551 | 554 | */ |
| 552 | 555 | if( !(i==2 && zName[1]==':') ){ |
| 553 | 556 | #endif |
| 554 | 557 | if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){ |
| 555 | - fossil_fatal_recursive("unable to create directory %s", zName); | |
| 556 | - return; | |
| 558 | + if (errorReturn <= 0) { | |
| 559 | + fossil_fatal_recursive("unable to create directory %s", zName); | |
| 560 | + } | |
| 561 | + rc = errorReturn; | |
| 562 | + break; | |
| 557 | 563 | } |
| 558 | 564 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 559 | 565 | } |
| 560 | 566 | #endif |
| 561 | 567 | zName[i] = '/'; |
| 562 | 568 | } |
| 563 | 569 | } |
| 564 | 570 | free(zName); |
| 571 | + return rc; | |
| 565 | 572 | } |
| 566 | 573 | |
| 567 | 574 | /* |
| 568 | 575 | ** Removes the directory named in the argument, if it exists. The directory |
| 569 | 576 | ** must be empty and cannot be the current directory or the root directory. |
| 570 | 577 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | FILE *in, *out; |
| 387 | int got; |
| 388 | char zBuf[8192]; |
| 389 | in = fossil_fopen(zFrom, "rb"); |
| 390 | if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom); |
| 391 | file_mkfolder(zTo, 0); |
| 392 | out = fossil_fopen(zTo, "wb"); |
| 393 | if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo); |
| 394 | while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){ |
| 395 | fwrite(zBuf, 1, got, out); |
| 396 | } |
| @@ -530,13 +530,16 @@ | |
| 530 | } |
| 531 | |
| 532 | /* |
| 533 | ** Create the tree of directories in which zFilename belongs, if that sequence |
| 534 | ** of directories does not already exist. |
| 535 | */ |
| 536 | void file_mkfolder(const char *zFilename, int forceFlag){ |
| 537 | int i, nName; |
| 538 | char *zName; |
| 539 | |
| 540 | nName = strlen(zFilename); |
| 541 | zName = mprintf("%s", zFilename); |
| 542 | nName = file_simplify_name(zName, nName, 0); |
| @@ -550,20 +553,24 @@ | |
| 550 | ** C: in this example. |
| 551 | */ |
| 552 | if( !(i==2 && zName[1]==':') ){ |
| 553 | #endif |
| 554 | if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){ |
| 555 | fossil_fatal_recursive("unable to create directory %s", zName); |
| 556 | return; |
| 557 | } |
| 558 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 559 | } |
| 560 | #endif |
| 561 | zName[i] = '/'; |
| 562 | } |
| 563 | } |
| 564 | free(zName); |
| 565 | } |
| 566 | |
| 567 | /* |
| 568 | ** Removes the directory named in the argument, if it exists. The directory |
| 569 | ** must be empty and cannot be the current directory or the root directory. |
| 570 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | FILE *in, *out; |
| 387 | int got; |
| 388 | char zBuf[8192]; |
| 389 | in = fossil_fopen(zFrom, "rb"); |
| 390 | if( in==0 ) fossil_fatal("cannot open \"%s\" for reading", zFrom); |
| 391 | file_mkfolder(zTo, 0, 0); |
| 392 | out = fossil_fopen(zTo, "wb"); |
| 393 | if( out==0 ) fossil_fatal("cannot open \"%s\" for writing", zTo); |
| 394 | while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){ |
| 395 | fwrite(zBuf, 1, got, out); |
| 396 | } |
| @@ -530,13 +530,16 @@ | |
| 530 | } |
| 531 | |
| 532 | /* |
| 533 | ** Create the tree of directories in which zFilename belongs, if that sequence |
| 534 | ** of directories does not already exist. |
| 535 | ** |
| 536 | ** On success, return zero. On error, return errorReturn if positive, otherwise |
| 537 | ** print an error message and abort. |
| 538 | */ |
| 539 | int file_mkfolder(const char *zFilename, int forceFlag, int errorReturn){ |
| 540 | int i, nName, rc = 0; |
| 541 | char *zName; |
| 542 | |
| 543 | nName = strlen(zFilename); |
| 544 | zName = mprintf("%s", zFilename); |
| 545 | nName = file_simplify_name(zName, nName, 0); |
| @@ -550,20 +553,24 @@ | |
| 553 | ** C: in this example. |
| 554 | */ |
| 555 | if( !(i==2 && zName[1]==':') ){ |
| 556 | #endif |
| 557 | if( file_mkdir(zName, forceFlag) && file_isdir(zName)!=1 ){ |
| 558 | if (errorReturn <= 0) { |
| 559 | fossil_fatal_recursive("unable to create directory %s", zName); |
| 560 | } |
| 561 | rc = errorReturn; |
| 562 | break; |
| 563 | } |
| 564 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 565 | } |
| 566 | #endif |
| 567 | zName[i] = '/'; |
| 568 | } |
| 569 | } |
| 570 | free(zName); |
| 571 | return rc; |
| 572 | } |
| 573 | |
| 574 | /* |
| 575 | ** Removes the directory named in the argument, if it exists. The directory |
| 576 | ** must be empty and cannot be the current directory or the root directory. |
| 577 |
+11
-10
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -134,16 +134,16 @@ | ||
| 134 | 134 | return mprintf("%.*s", i, zIP); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /* |
| 138 | 138 | ** Return an abbreviated project code. The abbreviation is the first |
| 139 | -** 16 characters of the project code. | |
| 139 | +** 16 characters of the project code, or "x" if there is no project-code. | |
| 140 | 140 | ** |
| 141 | 141 | ** Memory is obtained from malloc. |
| 142 | 142 | */ |
| 143 | 143 | static char *abbreviated_project_code(const char *zFullCode){ |
| 144 | - return mprintf("%.16s", zFullCode); | |
| 144 | + return mprintf("%.16s", zFullCode ? zFullCode : "x"); | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | /* |
| 149 | 149 | ** Check to see if the anonymous login is valid. If it is valid, return |
| @@ -232,15 +232,17 @@ | ||
| 232 | 232 | ** subsequently stored in user.cookie for later validation. |
| 233 | 233 | ** |
| 234 | 234 | ** The returned memory should be free()d after use. |
| 235 | 235 | */ |
| 236 | 236 | char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){ |
| 237 | - char *zProjCode = db_get("project-code",NULL); | |
| 238 | - char *zCode = abbreviated_project_code(zProjCode); | |
| 239 | - free(zProjCode); | |
| 237 | + char *zCode = abbreviated_project_code(db_get("project-code", 0)); | |
| 238 | + char *zCookie; | |
| 239 | + | |
| 240 | 240 | assert((zUsername && *zUsername) && "Invalid user data."); |
| 241 | - return mprintf("%s/%z/%s", zHash, zCode, zUsername); | |
| 241 | + zCookie = mprintf("%s/%z/%s", zHash, zCode, zUsername); | |
| 242 | + free(zCode); | |
| 243 | + return zCookie; | |
| 242 | 244 | } |
| 243 | 245 | |
| 244 | 246 | /* |
| 245 | 247 | ** Generates a login cookie for NON-ANONYMOUS users. Note that this |
| 246 | 248 | ** function "could" figure out the uid by itself but it currently |
| @@ -1455,11 +1457,11 @@ | ||
| 1455 | 1457 | Stmt q; /* Query of all peer-* entries in CONFIG */ |
| 1456 | 1458 | |
| 1457 | 1459 | if( zPrefix==0 ) zPrefix = ""; |
| 1458 | 1460 | if( zSuffix==0 ) zSuffix = ""; |
| 1459 | 1461 | if( pzErrorMsg ) *pzErrorMsg = 0; |
| 1460 | - zSelfCode = abbreviated_project_code(db_get("project-code", "x")); | |
| 1462 | + zSelfCode = abbreviated_project_code(db_get("project-code", 0)); | |
| 1461 | 1463 | blob_zero(&err); |
| 1462 | 1464 | db_prepare(&q, |
| 1463 | 1465 | "SELECT name, value FROM config" |
| 1464 | 1466 | " WHERE name GLOB 'peer-repo-*'" |
| 1465 | 1467 | " AND name <> 'peer-repo-%q'" |
| @@ -1549,11 +1551,11 @@ | ||
| 1549 | 1551 | /* Get the full pathname for our repository. Also the project code |
| 1550 | 1552 | ** and project name for ourself. */ |
| 1551 | 1553 | file_canonical_name(g.zRepositoryName, &fullName, 0); |
| 1552 | 1554 | zSelfRepo = fossil_strdup(blob_str(&fullName)); |
| 1553 | 1555 | blob_reset(&fullName); |
| 1554 | - zSelfProjCode = db_get("project-code", "unknown"); | |
| 1556 | + zSelfProjCode = abbreviated_project_code(db_get("project-code", 0)); | |
| 1555 | 1557 | zSelfLabel = db_get("project-name", 0); |
| 1556 | 1558 | if( zSelfLabel==0 ){ |
| 1557 | 1559 | zSelfLabel = zSelfProjCode; |
| 1558 | 1560 | } |
| 1559 | 1561 | |
| @@ -1601,11 +1603,10 @@ | ||
| 1601 | 1603 | } |
| 1602 | 1604 | |
| 1603 | 1605 | /* Create all the necessary CONFIG table entries on both the |
| 1604 | 1606 | ** other repository and on our own repository. |
| 1605 | 1607 | */ |
| 1606 | - zSelfProjCode = abbreviated_project_code(zSelfProjCode); | |
| 1607 | 1608 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1608 | 1609 | db_begin_transaction(); |
| 1609 | 1610 | db_multi_exec( |
| 1610 | 1611 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1611 | 1612 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| @@ -1650,11 +1651,11 @@ | ||
| 1650 | 1651 | void login_group_leave(char **pzErrMsg){ |
| 1651 | 1652 | char *zProjCode; |
| 1652 | 1653 | char *zSql; |
| 1653 | 1654 | |
| 1654 | 1655 | *pzErrMsg = 0; |
| 1655 | - zProjCode = abbreviated_project_code(db_get("project-code","x")); | |
| 1656 | + zProjCode = abbreviated_project_code(db_get("project-code", 0)); | |
| 1656 | 1657 | zSql = mprintf( |
| 1657 | 1658 | "DELETE FROM config WHERE name GLOB 'peer-*-%q';" |
| 1658 | 1659 | "DELETE FROM config" |
| 1659 | 1660 | " WHERE name='login-group-name'" |
| 1660 | 1661 | " AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;", |
| 1661 | 1662 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -134,16 +134,16 @@ | |
| 134 | return mprintf("%.*s", i, zIP); |
| 135 | } |
| 136 | |
| 137 | /* |
| 138 | ** Return an abbreviated project code. The abbreviation is the first |
| 139 | ** 16 characters of the project code. |
| 140 | ** |
| 141 | ** Memory is obtained from malloc. |
| 142 | */ |
| 143 | static char *abbreviated_project_code(const char *zFullCode){ |
| 144 | return mprintf("%.16s", zFullCode); |
| 145 | } |
| 146 | |
| 147 | |
| 148 | /* |
| 149 | ** Check to see if the anonymous login is valid. If it is valid, return |
| @@ -232,15 +232,17 @@ | |
| 232 | ** subsequently stored in user.cookie for later validation. |
| 233 | ** |
| 234 | ** The returned memory should be free()d after use. |
| 235 | */ |
| 236 | char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){ |
| 237 | char *zProjCode = db_get("project-code",NULL); |
| 238 | char *zCode = abbreviated_project_code(zProjCode); |
| 239 | free(zProjCode); |
| 240 | assert((zUsername && *zUsername) && "Invalid user data."); |
| 241 | return mprintf("%s/%z/%s", zHash, zCode, zUsername); |
| 242 | } |
| 243 | |
| 244 | /* |
| 245 | ** Generates a login cookie for NON-ANONYMOUS users. Note that this |
| 246 | ** function "could" figure out the uid by itself but it currently |
| @@ -1455,11 +1457,11 @@ | |
| 1455 | Stmt q; /* Query of all peer-* entries in CONFIG */ |
| 1456 | |
| 1457 | if( zPrefix==0 ) zPrefix = ""; |
| 1458 | if( zSuffix==0 ) zSuffix = ""; |
| 1459 | if( pzErrorMsg ) *pzErrorMsg = 0; |
| 1460 | zSelfCode = abbreviated_project_code(db_get("project-code", "x")); |
| 1461 | blob_zero(&err); |
| 1462 | db_prepare(&q, |
| 1463 | "SELECT name, value FROM config" |
| 1464 | " WHERE name GLOB 'peer-repo-*'" |
| 1465 | " AND name <> 'peer-repo-%q'" |
| @@ -1549,11 +1551,11 @@ | |
| 1549 | /* Get the full pathname for our repository. Also the project code |
| 1550 | ** and project name for ourself. */ |
| 1551 | file_canonical_name(g.zRepositoryName, &fullName, 0); |
| 1552 | zSelfRepo = fossil_strdup(blob_str(&fullName)); |
| 1553 | blob_reset(&fullName); |
| 1554 | zSelfProjCode = db_get("project-code", "unknown"); |
| 1555 | zSelfLabel = db_get("project-name", 0); |
| 1556 | if( zSelfLabel==0 ){ |
| 1557 | zSelfLabel = zSelfProjCode; |
| 1558 | } |
| 1559 | |
| @@ -1601,11 +1603,10 @@ | |
| 1601 | } |
| 1602 | |
| 1603 | /* Create all the necessary CONFIG table entries on both the |
| 1604 | ** other repository and on our own repository. |
| 1605 | */ |
| 1606 | zSelfProjCode = abbreviated_project_code(zSelfProjCode); |
| 1607 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1608 | db_begin_transaction(); |
| 1609 | db_multi_exec( |
| 1610 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1611 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| @@ -1650,11 +1651,11 @@ | |
| 1650 | void login_group_leave(char **pzErrMsg){ |
| 1651 | char *zProjCode; |
| 1652 | char *zSql; |
| 1653 | |
| 1654 | *pzErrMsg = 0; |
| 1655 | zProjCode = abbreviated_project_code(db_get("project-code","x")); |
| 1656 | zSql = mprintf( |
| 1657 | "DELETE FROM config WHERE name GLOB 'peer-*-%q';" |
| 1658 | "DELETE FROM config" |
| 1659 | " WHERE name='login-group-name'" |
| 1660 | " AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;", |
| 1661 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -134,16 +134,16 @@ | |
| 134 | return mprintf("%.*s", i, zIP); |
| 135 | } |
| 136 | |
| 137 | /* |
| 138 | ** Return an abbreviated project code. The abbreviation is the first |
| 139 | ** 16 characters of the project code, or "x" if there is no project-code. |
| 140 | ** |
| 141 | ** Memory is obtained from malloc. |
| 142 | */ |
| 143 | static char *abbreviated_project_code(const char *zFullCode){ |
| 144 | return mprintf("%.16s", zFullCode ? zFullCode : "x"); |
| 145 | } |
| 146 | |
| 147 | |
| 148 | /* |
| 149 | ** Check to see if the anonymous login is valid. If it is valid, return |
| @@ -232,15 +232,17 @@ | |
| 232 | ** subsequently stored in user.cookie for later validation. |
| 233 | ** |
| 234 | ** The returned memory should be free()d after use. |
| 235 | */ |
| 236 | char *login_gen_user_cookie_value(const char *zUsername, const char *zHash){ |
| 237 | char *zCode = abbreviated_project_code(db_get("project-code", 0)); |
| 238 | char *zCookie; |
| 239 | |
| 240 | assert((zUsername && *zUsername) && "Invalid user data."); |
| 241 | zCookie = mprintf("%s/%z/%s", zHash, zCode, zUsername); |
| 242 | free(zCode); |
| 243 | return zCookie; |
| 244 | } |
| 245 | |
| 246 | /* |
| 247 | ** Generates a login cookie for NON-ANONYMOUS users. Note that this |
| 248 | ** function "could" figure out the uid by itself but it currently |
| @@ -1455,11 +1457,11 @@ | |
| 1457 | Stmt q; /* Query of all peer-* entries in CONFIG */ |
| 1458 | |
| 1459 | if( zPrefix==0 ) zPrefix = ""; |
| 1460 | if( zSuffix==0 ) zSuffix = ""; |
| 1461 | if( pzErrorMsg ) *pzErrorMsg = 0; |
| 1462 | zSelfCode = abbreviated_project_code(db_get("project-code", 0)); |
| 1463 | blob_zero(&err); |
| 1464 | db_prepare(&q, |
| 1465 | "SELECT name, value FROM config" |
| 1466 | " WHERE name GLOB 'peer-repo-*'" |
| 1467 | " AND name <> 'peer-repo-%q'" |
| @@ -1549,11 +1551,11 @@ | |
| 1551 | /* Get the full pathname for our repository. Also the project code |
| 1552 | ** and project name for ourself. */ |
| 1553 | file_canonical_name(g.zRepositoryName, &fullName, 0); |
| 1554 | zSelfRepo = fossil_strdup(blob_str(&fullName)); |
| 1555 | blob_reset(&fullName); |
| 1556 | zSelfProjCode = abbreviated_project_code(db_get("project-code", 0)); |
| 1557 | zSelfLabel = db_get("project-name", 0); |
| 1558 | if( zSelfLabel==0 ){ |
| 1559 | zSelfLabel = zSelfProjCode; |
| 1560 | } |
| 1561 | |
| @@ -1601,11 +1603,10 @@ | |
| 1603 | } |
| 1604 | |
| 1605 | /* Create all the necessary CONFIG table entries on both the |
| 1606 | ** other repository and on our own repository. |
| 1607 | */ |
| 1608 | zOtherProjCode = abbreviated_project_code(zOtherProjCode); |
| 1609 | db_begin_transaction(); |
| 1610 | db_multi_exec( |
| 1611 | "DELETE FROM \"%w\".config WHERE name GLOB 'peer-*';" |
| 1612 | "INSERT INTO \"%w\".config(name,value) VALUES('peer-repo-%q',%Q);" |
| @@ -1650,11 +1651,11 @@ | |
| 1651 | void login_group_leave(char **pzErrMsg){ |
| 1652 | char *zProjCode; |
| 1653 | char *zSql; |
| 1654 | |
| 1655 | *pzErrMsg = 0; |
| 1656 | zProjCode = abbreviated_project_code(db_get("project-code", 0)); |
| 1657 | zSql = mprintf( |
| 1658 | "DELETE FROM config WHERE name GLOB 'peer-*-%q';" |
| 1659 | "DELETE FROM config" |
| 1660 | " WHERE name='login-group-name'" |
| 1661 | " AND (SELECT count(*) FROM config WHERE name GLOB 'peer-*')==0;", |
| 1662 |
+5
-5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -786,11 +786,11 @@ | ||
| 786 | 786 | }else{ |
| 787 | 787 | @ mergeOffset = railPitch-minRailPitch-mLine.w; |
| 788 | 788 | @ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w); |
| 789 | 789 | @ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0; |
| 790 | 790 | } |
| 791 | - @ | |
| 791 | + @ | |
| 792 | 792 | @ var canvasWidth = (nrail-1)*railPitch + node.w; |
| 793 | 793 | @ canvasDiv.style.width = canvasWidth + "px"; |
| 794 | 794 | @ canvasDiv.style.position = "relative"; |
| 795 | 795 | @ } |
| 796 | 796 | @ function drawBox(cls,color,x0,y0,x1,y1){ |
| @@ -1277,24 +1277,24 @@ | ||
| 1277 | 1277 | return; |
| 1278 | 1278 | } |
| 1279 | 1279 | url_initialize(&url, "timeline"); |
| 1280 | 1280 | cgi_query_parameters_to_url(&url); |
| 1281 | 1281 | if( zTagName && g.perm.Read ){ |
| 1282 | - tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName); | |
| 1282 | + tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zTagName); | |
| 1283 | 1283 | zThisTag = zTagName; |
| 1284 | 1284 | }else if( zBrName && g.perm.Read ){ |
| 1285 | - tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName); | |
| 1285 | + tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName); | |
| 1286 | 1286 | zThisTag = zBrName; |
| 1287 | 1287 | }else{ |
| 1288 | 1288 | tagid = 0; |
| 1289 | 1289 | } |
| 1290 | 1290 | if( zMark && zMark[0]==0 ){ |
| 1291 | 1291 | if( zAfter ) zMark = zAfter; |
| 1292 | 1292 | if( zBefore ) zMark = zBefore; |
| 1293 | 1293 | if( zCirca ) zMark = zCirca; |
| 1294 | 1294 | } |
| 1295 | - if( tagid>0 | |
| 1295 | + if( tagid | |
| 1296 | 1296 | && db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry |
| 1297 | 1297 | ){ |
| 1298 | 1298 | nEntry = -1; |
| 1299 | 1299 | zCirca = 0; |
| 1300 | 1300 | } |
| @@ -1493,11 +1493,11 @@ | ||
| 1493 | 1493 | } |
| 1494 | 1494 | else if( zYearWeek ){ |
| 1495 | 1495 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1496 | 1496 | zYearWeek); |
| 1497 | 1497 | } |
| 1498 | - if( tagid>0 ){ | |
| 1498 | + if( tagid ){ | |
| 1499 | 1499 | blob_append_sql(&sql, |
| 1500 | 1500 | " AND (EXISTS(SELECT 1 FROM tagxref" |
| 1501 | 1501 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid); |
| 1502 | 1502 | |
| 1503 | 1503 | if( zBrName ){ |
| 1504 | 1504 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -786,11 +786,11 @@ | |
| 786 | }else{ |
| 787 | @ mergeOffset = railPitch-minRailPitch-mLine.w; |
| 788 | @ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w); |
| 789 | @ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0; |
| 790 | } |
| 791 | @ |
| 792 | @ var canvasWidth = (nrail-1)*railPitch + node.w; |
| 793 | @ canvasDiv.style.width = canvasWidth + "px"; |
| 794 | @ canvasDiv.style.position = "relative"; |
| 795 | @ } |
| 796 | @ function drawBox(cls,color,x0,y0,x1,y1){ |
| @@ -1277,24 +1277,24 @@ | |
| 1277 | return; |
| 1278 | } |
| 1279 | url_initialize(&url, "timeline"); |
| 1280 | cgi_query_parameters_to_url(&url); |
| 1281 | if( zTagName && g.perm.Read ){ |
| 1282 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'", zTagName); |
| 1283 | zThisTag = zTagName; |
| 1284 | }else if( zBrName && g.perm.Read ){ |
| 1285 | tagid = db_int(0, "SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName); |
| 1286 | zThisTag = zBrName; |
| 1287 | }else{ |
| 1288 | tagid = 0; |
| 1289 | } |
| 1290 | if( zMark && zMark[0]==0 ){ |
| 1291 | if( zAfter ) zMark = zAfter; |
| 1292 | if( zBefore ) zMark = zBefore; |
| 1293 | if( zCirca ) zMark = zCirca; |
| 1294 | } |
| 1295 | if( tagid>0 |
| 1296 | && db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry |
| 1297 | ){ |
| 1298 | nEntry = -1; |
| 1299 | zCirca = 0; |
| 1300 | } |
| @@ -1493,11 +1493,11 @@ | |
| 1493 | } |
| 1494 | else if( zYearWeek ){ |
| 1495 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1496 | zYearWeek); |
| 1497 | } |
| 1498 | if( tagid>0 ){ |
| 1499 | blob_append_sql(&sql, |
| 1500 | " AND (EXISTS(SELECT 1 FROM tagxref" |
| 1501 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid); |
| 1502 | |
| 1503 | if( zBrName ){ |
| 1504 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -786,11 +786,11 @@ | |
| 786 | }else{ |
| 787 | @ mergeOffset = railPitch-minRailPitch-mLine.w; |
| 788 | @ mergeOffset = Math.min(mergeOffset, elems.mergeoffset.w); |
| 789 | @ mergeOffset = mergeOffset>0 ? mergeOffset + line.w/2 : 0; |
| 790 | } |
| 791 | @ |
| 792 | @ var canvasWidth = (nrail-1)*railPitch + node.w; |
| 793 | @ canvasDiv.style.width = canvasWidth + "px"; |
| 794 | @ canvasDiv.style.position = "relative"; |
| 795 | @ } |
| 796 | @ function drawBox(cls,color,x0,y0,x1,y1){ |
| @@ -1277,24 +1277,24 @@ | |
| 1277 | return; |
| 1278 | } |
| 1279 | url_initialize(&url, "timeline"); |
| 1280 | cgi_query_parameters_to_url(&url); |
| 1281 | if( zTagName && g.perm.Read ){ |
| 1282 | tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zTagName); |
| 1283 | zThisTag = zTagName; |
| 1284 | }else if( zBrName && g.perm.Read ){ |
| 1285 | tagid = db_int(-1,"SELECT tagid FROM tag WHERE tagname='sym-%q'",zBrName); |
| 1286 | zThisTag = zBrName; |
| 1287 | }else{ |
| 1288 | tagid = 0; |
| 1289 | } |
| 1290 | if( zMark && zMark[0]==0 ){ |
| 1291 | if( zAfter ) zMark = zAfter; |
| 1292 | if( zBefore ) zMark = zBefore; |
| 1293 | if( zCirca ) zMark = zCirca; |
| 1294 | } |
| 1295 | if( tagid |
| 1296 | && db_int(0,"SELECT count(*) FROM tagxref WHERE tagid=%d",tagid)<=nEntry |
| 1297 | ){ |
| 1298 | nEntry = -1; |
| 1299 | zCirca = 0; |
| 1300 | } |
| @@ -1493,11 +1493,11 @@ | |
| 1493 | } |
| 1494 | else if( zYearWeek ){ |
| 1495 | blob_append_sql(&sql, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1496 | zYearWeek); |
| 1497 | } |
| 1498 | if( tagid ){ |
| 1499 | blob_append_sql(&sql, |
| 1500 | " AND (EXISTS(SELECT 1 FROM tagxref" |
| 1501 | " WHERE tagid=%d AND tagtype>0 AND rid=blob.rid)\n", tagid); |
| 1502 | |
| 1503 | if( zBrName ){ |
| 1504 |
+5
-5
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -40,15 +40,15 @@ | ||
| 40 | 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | 41 | ** as such. |
| 42 | 42 | ** |
| 43 | 43 | ** Enhancement #2: |
| 44 | 44 | ** |
| 45 | -** Comments of the form: "/* @-comment: CC" cause CC to become a | |
| 46 | -** comment character for the @-substitution. Typical values for CC are | |
| 47 | -** "--" (for SQL text) or "#" (for Tcl script) or "//" (for C++ code). | |
| 48 | -** Lines of subsequent @-blocks that begin with CC are omitted from the | |
| 49 | -** output. | |
| 45 | +** Comments of the form: "|* @-comment: CC" (where "|" is really "/") | |
| 46 | +** cause CC to become a comment character for the @-substitution. | |
| 47 | +** Typical values for CC are "--" (for SQL text) or "#" (for Tcl script) | |
| 48 | +** or "//" (for C++ code). Lines of subsequent @-blocks that begin with | |
| 49 | +** CC are omitted from the output. | |
| 50 | 50 | ** |
| 51 | 51 | */ |
| 52 | 52 | #include <stdio.h> |
| 53 | 53 | #include <ctype.h> |
| 54 | 54 | #include <stdlib.h> |
| 55 | 55 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -40,15 +40,15 @@ | |
| 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | ** as such. |
| 42 | ** |
| 43 | ** Enhancement #2: |
| 44 | ** |
| 45 | ** Comments of the form: "/* @-comment: CC" cause CC to become a |
| 46 | ** comment character for the @-substitution. Typical values for CC are |
| 47 | ** "--" (for SQL text) or "#" (for Tcl script) or "//" (for C++ code). |
| 48 | ** Lines of subsequent @-blocks that begin with CC are omitted from the |
| 49 | ** output. |
| 50 | ** |
| 51 | */ |
| 52 | #include <stdio.h> |
| 53 | #include <ctype.h> |
| 54 | #include <stdlib.h> |
| 55 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -40,15 +40,15 @@ | |
| 40 | ** rather than text that is to be output via cgi_printf(). Render it |
| 41 | ** as such. |
| 42 | ** |
| 43 | ** Enhancement #2: |
| 44 | ** |
| 45 | ** Comments of the form: "|* @-comment: CC" (where "|" is really "/") |
| 46 | ** cause CC to become a comment character for the @-substitution. |
| 47 | ** Typical values for CC are "--" (for SQL text) or "#" (for Tcl script) |
| 48 | ** or "//" (for C++ code). Lines of subsequent @-blocks that begin with |
| 49 | ** CC are omitted from the output. |
| 50 | ** |
| 51 | */ |
| 52 | #include <stdio.h> |
| 53 | #include <ctype.h> |
| 54 | #include <stdlib.h> |
| 55 |
+16
-24
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -586,43 +586,32 @@ | ||
| 586 | 586 | db_end_transaction(0); |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | /* |
| 591 | -** Make sure empty directories are created | |
| 591 | +** Create empty directories specified by the empty-dirs setting. | |
| 592 | 592 | */ |
| 593 | 593 | void ensure_empty_dirs_created(void){ |
| 594 | - /* Make empty directories? */ | |
| 595 | 594 | char *zEmptyDirs = db_get("empty-dirs", 0); |
| 596 | 595 | if( zEmptyDirs!=0 ){ |
| 597 | - char *bc; | |
| 596 | + int i; | |
| 598 | 597 | Blob dirName; |
| 599 | 598 | Blob dirsList; |
| 600 | 599 | |
| 601 | - blob_zero(&dirsList); | |
| 602 | - blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs)); | |
| 603 | - /* Replace commas by spaces */ | |
| 604 | - bc = blob_str(&dirsList); | |
| 605 | - while( (*bc)!='\0' ){ | |
| 606 | - if( (*bc)==',' ) { *bc = ' '; } | |
| 607 | - ++bc; | |
| 608 | - } | |
| 609 | - /* Make directories */ | |
| 610 | - blob_zero(&dirName); | |
| 600 | + zEmptyDirs = fossil_strdup(zEmptyDirs); | |
| 601 | + for(i=0; zEmptyDirs[i]; i++){ | |
| 602 | + if( zEmptyDirs[i]==',' ) zEmptyDirs[i] = ' '; | |
| 603 | + } | |
| 604 | + blob_init(&dirsList, zEmptyDirs, -1); | |
| 611 | 605 | while( blob_token(&dirsList, &dirName) ){ |
| 612 | - const char *zDir = blob_str(&dirName); | |
| 613 | - /* Make full pathname of the directory */ | |
| 614 | - Blob path; | |
| 615 | - const char *zPath; | |
| 616 | - | |
| 617 | - blob_zero(&path); | |
| 618 | - blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); | |
| 619 | - zPath = blob_str(&path); | |
| 620 | - /* Handle various cases of existence of the directory */ | |
| 606 | + char *zDir = blob_str(&dirName); | |
| 607 | + char *zPath = mprintf("%s/%s", g.zLocalRoot, zDir); | |
| 621 | 608 | switch( file_wd_isdir(zPath) ){ |
| 622 | 609 | case 0: { /* doesn't exist */ |
| 623 | - if( file_mkdir(zPath, 0)!=0 ) { | |
| 610 | + fossil_free(zPath); | |
| 611 | + zPath = mprintf("%s/%s/x", g.zLocalRoot, zDir); | |
| 612 | + if( file_mkfolder(zPath, 0, 1)!=0 ) { | |
| 624 | 613 | fossil_warning("couldn't create directory %s as " |
| 625 | 614 | "required by empty-dirs setting", zDir); |
| 626 | 615 | } |
| 627 | 616 | break; |
| 628 | 617 | } |
| @@ -633,12 +622,15 @@ | ||
| 633 | 622 | case 2: { /* exists, but isn't a directory */ |
| 634 | 623 | fossil_warning("file %s found, but a directory is required " |
| 635 | 624 | "by empty-dirs setting", zDir); |
| 636 | 625 | } |
| 637 | 626 | } |
| 638 | - blob_reset(&path); | |
| 627 | + fossil_free(zPath); | |
| 628 | + blob_reset(&dirName); | |
| 639 | 629 | } |
| 630 | + blob_reset(&dirsList); | |
| 631 | + fossil_free(zEmptyDirs); | |
| 640 | 632 | } |
| 641 | 633 | } |
| 642 | 634 | |
| 643 | 635 | |
| 644 | 636 | /* |
| 645 | 637 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -586,43 +586,32 @@ | |
| 586 | db_end_transaction(0); |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | /* |
| 591 | ** Make sure empty directories are created |
| 592 | */ |
| 593 | void ensure_empty_dirs_created(void){ |
| 594 | /* Make empty directories? */ |
| 595 | char *zEmptyDirs = db_get("empty-dirs", 0); |
| 596 | if( zEmptyDirs!=0 ){ |
| 597 | char *bc; |
| 598 | Blob dirName; |
| 599 | Blob dirsList; |
| 600 | |
| 601 | blob_zero(&dirsList); |
| 602 | blob_init(&dirsList, zEmptyDirs, strlen(zEmptyDirs)); |
| 603 | /* Replace commas by spaces */ |
| 604 | bc = blob_str(&dirsList); |
| 605 | while( (*bc)!='\0' ){ |
| 606 | if( (*bc)==',' ) { *bc = ' '; } |
| 607 | ++bc; |
| 608 | } |
| 609 | /* Make directories */ |
| 610 | blob_zero(&dirName); |
| 611 | while( blob_token(&dirsList, &dirName) ){ |
| 612 | const char *zDir = blob_str(&dirName); |
| 613 | /* Make full pathname of the directory */ |
| 614 | Blob path; |
| 615 | const char *zPath; |
| 616 | |
| 617 | blob_zero(&path); |
| 618 | blob_appendf(&path, "%s/%s", g.zLocalRoot, zDir); |
| 619 | zPath = blob_str(&path); |
| 620 | /* Handle various cases of existence of the directory */ |
| 621 | switch( file_wd_isdir(zPath) ){ |
| 622 | case 0: { /* doesn't exist */ |
| 623 | if( file_mkdir(zPath, 0)!=0 ) { |
| 624 | fossil_warning("couldn't create directory %s as " |
| 625 | "required by empty-dirs setting", zDir); |
| 626 | } |
| 627 | break; |
| 628 | } |
| @@ -633,12 +622,15 @@ | |
| 633 | case 2: { /* exists, but isn't a directory */ |
| 634 | fossil_warning("file %s found, but a directory is required " |
| 635 | "by empty-dirs setting", zDir); |
| 636 | } |
| 637 | } |
| 638 | blob_reset(&path); |
| 639 | } |
| 640 | } |
| 641 | } |
| 642 | |
| 643 | |
| 644 | /* |
| 645 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -586,43 +586,32 @@ | |
| 586 | db_end_transaction(0); |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | /* |
| 591 | ** Create empty directories specified by the empty-dirs setting. |
| 592 | */ |
| 593 | void ensure_empty_dirs_created(void){ |
| 594 | char *zEmptyDirs = db_get("empty-dirs", 0); |
| 595 | if( zEmptyDirs!=0 ){ |
| 596 | int i; |
| 597 | Blob dirName; |
| 598 | Blob dirsList; |
| 599 | |
| 600 | zEmptyDirs = fossil_strdup(zEmptyDirs); |
| 601 | for(i=0; zEmptyDirs[i]; i++){ |
| 602 | if( zEmptyDirs[i]==',' ) zEmptyDirs[i] = ' '; |
| 603 | } |
| 604 | blob_init(&dirsList, zEmptyDirs, -1); |
| 605 | while( blob_token(&dirsList, &dirName) ){ |
| 606 | char *zDir = blob_str(&dirName); |
| 607 | char *zPath = mprintf("%s/%s", g.zLocalRoot, zDir); |
| 608 | switch( file_wd_isdir(zPath) ){ |
| 609 | case 0: { /* doesn't exist */ |
| 610 | fossil_free(zPath); |
| 611 | zPath = mprintf("%s/%s/x", g.zLocalRoot, zDir); |
| 612 | if( file_mkfolder(zPath, 0, 1)!=0 ) { |
| 613 | fossil_warning("couldn't create directory %s as " |
| 614 | "required by empty-dirs setting", zDir); |
| 615 | } |
| 616 | break; |
| 617 | } |
| @@ -633,12 +622,15 @@ | |
| 622 | case 2: { /* exists, but isn't a directory */ |
| 623 | fossil_warning("file %s found, but a directory is required " |
| 624 | "by empty-dirs setting", zDir); |
| 625 | } |
| 626 | } |
| 627 | fossil_free(zPath); |
| 628 | blob_reset(&dirName); |
| 629 | } |
| 630 | blob_reset(&dirsList); |
| 631 | fossil_free(zEmptyDirs); |
| 632 | } |
| 633 | } |
| 634 | |
| 635 | |
| 636 | /* |
| 637 |
+3
-1
| --- src/wikiformat.c | ||
| +++ src/wikiformat.c | ||
| @@ -1151,11 +1151,13 @@ | ||
| 1151 | 1151 | return zTarget+5; |
| 1152 | 1152 | } |
| 1153 | 1153 | if( strcmp(zTarget, "Sandbox")==0 ) return zTarget; |
| 1154 | 1154 | if( wiki_name_is_wellformed((const unsigned char *)zTarget) |
| 1155 | 1155 | && ((p->state & WIKI_NOBADLINKS)==0 || |
| 1156 | - db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'", zTarget)) | |
| 1156 | + db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'" | |
| 1157 | + " AND (SELECT value FROM tagxref WHERE tagid=tag.tagid" | |
| 1158 | + " ORDER BY mtime DESC LIMIT 1) > 0", zTarget)) | |
| 1157 | 1159 | ){ |
| 1158 | 1160 | return zTarget; |
| 1159 | 1161 | } |
| 1160 | 1162 | return 0; |
| 1161 | 1163 | } |
| 1162 | 1164 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1151,11 +1151,13 @@ | |
| 1151 | return zTarget+5; |
| 1152 | } |
| 1153 | if( strcmp(zTarget, "Sandbox")==0 ) return zTarget; |
| 1154 | if( wiki_name_is_wellformed((const unsigned char *)zTarget) |
| 1155 | && ((p->state & WIKI_NOBADLINKS)==0 || |
| 1156 | db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'", zTarget)) |
| 1157 | ){ |
| 1158 | return zTarget; |
| 1159 | } |
| 1160 | return 0; |
| 1161 | } |
| 1162 |
| --- src/wikiformat.c | |
| +++ src/wikiformat.c | |
| @@ -1151,11 +1151,13 @@ | |
| 1151 | return zTarget+5; |
| 1152 | } |
| 1153 | if( strcmp(zTarget, "Sandbox")==0 ) return zTarget; |
| 1154 | if( wiki_name_is_wellformed((const unsigned char *)zTarget) |
| 1155 | && ((p->state & WIKI_NOBADLINKS)==0 || |
| 1156 | db_exists("SELECT 1 FROM tag WHERE tagname GLOB 'wiki-%q'" |
| 1157 | " AND (SELECT value FROM tagxref WHERE tagid=tag.tagid" |
| 1158 | " ORDER BY mtime DESC LIMIT 1) > 0", zTarget)) |
| 1159 | ){ |
| 1160 | return zTarget; |
| 1161 | } |
| 1162 | return 0; |
| 1163 | } |
| 1164 |
+3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -43,10 +43,13 @@ | ||
| 43 | 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | 44 | changes on otherwise unmodified files. |
| 45 | 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | 47 | field for direct entry of the user name to each applicable report. |
| 48 | + * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't | |
| 49 | + already exist. | |
| 50 | + * Inhibit timeline links to wiki pages that have been deleted. | |
| 48 | 51 | |
| 49 | 52 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 50 | 53 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 51 | 54 | that the new repository is fully compatible with historical versions of |
| 52 | 55 | Fossil by having a valid manifest as RID 1. |
| 53 | 56 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -43,10 +43,13 @@ | |
| 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | changes on otherwise unmodified files. |
| 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | field for direct entry of the user name to each applicable report. |
| 48 | |
| 49 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 50 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 51 | that the new repository is fully compatible with historical versions of |
| 52 | Fossil by having a valid manifest as RID 1. |
| 53 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -43,10 +43,13 @@ | |
| 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | changes on otherwise unmodified files. |
| 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | field for direct entry of the user name to each applicable report. |
| 48 | * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't |
| 49 | already exist. |
| 50 | * Inhibit timeline links to wiki pages that have been deleted. |
| 51 | |
| 52 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 53 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 54 | that the new repository is fully compatible with historical versions of |
| 55 | Fossil by having a valid manifest as RID 1. |
| 56 |
+3
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -43,10 +43,13 @@ | ||
| 43 | 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | 44 | changes on otherwise unmodified files. |
| 45 | 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | 47 | field for direct entry of the user name to each applicable report. |
| 48 | + * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't | |
| 49 | + already exist. | |
| 50 | + * Inhibit timeline links to wiki pages that have been deleted. | |
| 48 | 51 | |
| 49 | 52 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 50 | 53 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 51 | 54 | that the new repository is fully compatible with historical versions of |
| 52 | 55 | Fossil by having a valid manifest as RID 1. |
| 53 | 56 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -43,10 +43,13 @@ | |
| 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | changes on otherwise unmodified files. |
| 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | field for direct entry of the user name to each applicable report. |
| 48 | |
| 49 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 50 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 51 | that the new repository is fully compatible with historical versions of |
| 52 | Fossil by having a valid manifest as RID 1. |
| 53 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -43,10 +43,13 @@ | |
| 43 | [/help?cmd=status|fossil status] report when executable or symlink status |
| 44 | changes on otherwise unmodified files. |
| 45 | * Permit filtering weekday and file [/help?cmd=/reports|reports] by user. |
| 46 | Also ensure the user parameter is preserved when changing types. Add a |
| 47 | field for direct entry of the user name to each applicable report. |
| 48 | * Create parent directories of [/help?cmd=settings|empty-dirs] if they don't |
| 49 | already exist. |
| 50 | * Inhibit timeline links to wiki pages that have been deleted. |
| 51 | |
| 52 | <h2>Changes for Version 1.32 (2015-03-14)</h2> |
| 53 | * When creating a new repository using [/help?cmd=init|fossil init], ensure |
| 54 | that the new repository is fully compatible with historical versions of |
| 55 | Fossil by having a valid manifest as RID 1. |
| 56 |