Fossil SCM
s/fossil_is_json/fossil_has_json/g. Moved fossil_has_json() (nee fossil_is_json()) decl/docs to json_detail.h.
Commit
d2c1ae23a90b24f6ca1d7637193a59d5ecf3e680
Parent
f5cc421dc20b41a…
6 files changed
+3
-18
+2
-2
+19
+6
-6
+1
-1
+1
-1
+3
-18
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -185,26 +185,11 @@ | ||
| 185 | 185 | #define END_TIMER 0.0 |
| 186 | 186 | #define HAS_TIMER 0 |
| 187 | 187 | #endif |
| 188 | 188 | |
| 189 | 189 | |
| 190 | -/* | |
| 191 | -** Returns true if fossil is running in JSON mode and we are either | |
| 192 | -** running in HTTP mode OR g.json.post.o is not NULL (meaning POST | |
| 193 | -** data was fed in from CLI mode). | |
| 194 | -** | |
| 195 | -** Specifically, it will return false when any of these apply: | |
| 196 | -** | |
| 197 | -** a) Not running in JSON mode (via json command or /json path). | |
| 198 | -** | |
| 199 | -** b) We are running in JSON CLI mode, but no POST data has been fed | |
| 200 | -** in. | |
| 201 | -** | |
| 202 | -** Whether or not we need to take args from CLI or POST data makes a | |
| 203 | -** difference in argument/parameter handling in many JSON rountines. | |
| 204 | -*/ | |
| 205 | -char fossil_is_json(){ | |
| 190 | +char fossil_has_json(){ | |
| 206 | 191 | return g.json.isJsonMode && (g.isHTTP || g.json.post.o); |
| 207 | 192 | } |
| 208 | 193 | |
| 209 | 194 | /* |
| 210 | 195 | ** Placeholder /json/XXX page impl for NYI (Not Yet Implemented) |
| @@ -586,11 +571,11 @@ | ||
| 586 | 571 | assert(NULL != zKey); |
| 587 | 572 | if(!g.isHTTP){ |
| 588 | 573 | rc = find_option(zCLILong ? zCLILong : zKey, |
| 589 | 574 | zCLIShort, 1); |
| 590 | 575 | } |
| 591 | - if(!rc && fossil_is_json()){ | |
| 576 | + if(!rc && fossil_has_json()){ | |
| 592 | 577 | rc = json_getenv_cstr(zKey); |
| 593 | 578 | } |
| 594 | 579 | if(!rc && (argPos>=0)){ |
| 595 | 580 | rc = json_command_arg((unsigned char)argPos); |
| 596 | 581 | } |
| @@ -616,11 +601,11 @@ | ||
| 616 | 601 | if(NULL != find_option(zCLILong ? zCLILong : zKey, |
| 617 | 602 | zCLIShort, 0)){ |
| 618 | 603 | rc = 1; |
| 619 | 604 | } |
| 620 | 605 | } |
| 621 | - if((-1==rc) && fossil_is_json()){ | |
| 606 | + if((-1==rc) && fossil_has_json()){ | |
| 622 | 607 | rc = json_getenv_bool(zKey,-1); |
| 623 | 608 | } |
| 624 | 609 | return (-1==rc) ? dflt : rc; |
| 625 | 610 | } |
| 626 | 611 | |
| 627 | 612 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -185,26 +185,11 @@ | |
| 185 | #define END_TIMER 0.0 |
| 186 | #define HAS_TIMER 0 |
| 187 | #endif |
| 188 | |
| 189 | |
| 190 | /* |
| 191 | ** Returns true if fossil is running in JSON mode and we are either |
| 192 | ** running in HTTP mode OR g.json.post.o is not NULL (meaning POST |
| 193 | ** data was fed in from CLI mode). |
| 194 | ** |
| 195 | ** Specifically, it will return false when any of these apply: |
| 196 | ** |
| 197 | ** a) Not running in JSON mode (via json command or /json path). |
| 198 | ** |
| 199 | ** b) We are running in JSON CLI mode, but no POST data has been fed |
| 200 | ** in. |
| 201 | ** |
| 202 | ** Whether or not we need to take args from CLI or POST data makes a |
| 203 | ** difference in argument/parameter handling in many JSON rountines. |
| 204 | */ |
| 205 | char fossil_is_json(){ |
| 206 | return g.json.isJsonMode && (g.isHTTP || g.json.post.o); |
| 207 | } |
| 208 | |
| 209 | /* |
| 210 | ** Placeholder /json/XXX page impl for NYI (Not Yet Implemented) |
| @@ -586,11 +571,11 @@ | |
| 586 | assert(NULL != zKey); |
| 587 | if(!g.isHTTP){ |
| 588 | rc = find_option(zCLILong ? zCLILong : zKey, |
| 589 | zCLIShort, 1); |
| 590 | } |
| 591 | if(!rc && fossil_is_json()){ |
| 592 | rc = json_getenv_cstr(zKey); |
| 593 | } |
| 594 | if(!rc && (argPos>=0)){ |
| 595 | rc = json_command_arg((unsigned char)argPos); |
| 596 | } |
| @@ -616,11 +601,11 @@ | |
| 616 | if(NULL != find_option(zCLILong ? zCLILong : zKey, |
| 617 | zCLIShort, 0)){ |
| 618 | rc = 1; |
| 619 | } |
| 620 | } |
| 621 | if((-1==rc) && fossil_is_json()){ |
| 622 | rc = json_getenv_bool(zKey,-1); |
| 623 | } |
| 624 | return (-1==rc) ? dflt : rc; |
| 625 | } |
| 626 | |
| 627 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -185,26 +185,11 @@ | |
| 185 | #define END_TIMER 0.0 |
| 186 | #define HAS_TIMER 0 |
| 187 | #endif |
| 188 | |
| 189 | |
| 190 | char fossil_has_json(){ |
| 191 | return g.json.isJsonMode && (g.isHTTP || g.json.post.o); |
| 192 | } |
| 193 | |
| 194 | /* |
| 195 | ** Placeholder /json/XXX page impl for NYI (Not Yet Implemented) |
| @@ -586,11 +571,11 @@ | |
| 571 | assert(NULL != zKey); |
| 572 | if(!g.isHTTP){ |
| 573 | rc = find_option(zCLILong ? zCLILong : zKey, |
| 574 | zCLIShort, 1); |
| 575 | } |
| 576 | if(!rc && fossil_has_json()){ |
| 577 | rc = json_getenv_cstr(zKey); |
| 578 | } |
| 579 | if(!rc && (argPos>=0)){ |
| 580 | rc = json_command_arg((unsigned char)argPos); |
| 581 | } |
| @@ -616,11 +601,11 @@ | |
| 601 | if(NULL != find_option(zCLILong ? zCLILong : zKey, |
| 602 | zCLIShort, 0)){ |
| 603 | rc = 1; |
| 604 | } |
| 605 | } |
| 606 | if((-1==rc) && fossil_has_json()){ |
| 607 | rc = json_getenv_bool(zKey,-1); |
| 608 | } |
| 609 | return (-1==rc) ? dflt : rc; |
| 610 | } |
| 611 | |
| 612 |
+2
-2
| --- src/json_branch.c | ||
| +++ src/json_branch.c | ||
| @@ -77,11 +77,11 @@ | ||
| 77 | 77 | } |
| 78 | 78 | payV = cson_value_new_object(); |
| 79 | 79 | pay = cson_value_get_object(payV); |
| 80 | 80 | listV = cson_value_new_array(); |
| 81 | 81 | list = cson_value_get_array(listV); |
| 82 | - if(fossil_is_json()){ | |
| 82 | + if(fossil_has_json()){ | |
| 83 | 83 | range = json_getenv_cstr("range"); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | range = json_find_option_cstr("range",NULL,"r"); |
| 87 | 87 | if((!range||!*range) && !g.isHTTP){ |
| @@ -326,11 +326,11 @@ | ||
| 326 | 326 | json_set_err(FSL_JSON_E_DENIED, |
| 327 | 327 | "Requires 'i' permissions."); |
| 328 | 328 | return NULL; |
| 329 | 329 | } |
| 330 | 330 | memset(&opt,0,sizeof(BranchCreateOptions)); |
| 331 | - if(fossil_is_json()){ | |
| 331 | + if(fossil_has_json()){ | |
| 332 | 332 | opt.zName = json_getenv_cstr("name"); |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | if(!opt.zName){ |
| 336 | 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 | 337 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | } |
| 78 | payV = cson_value_new_object(); |
| 79 | pay = cson_value_get_object(payV); |
| 80 | listV = cson_value_new_array(); |
| 81 | list = cson_value_get_array(listV); |
| 82 | if(fossil_is_json()){ |
| 83 | range = json_getenv_cstr("range"); |
| 84 | } |
| 85 | |
| 86 | range = json_find_option_cstr("range",NULL,"r"); |
| 87 | if((!range||!*range) && !g.isHTTP){ |
| @@ -326,11 +326,11 @@ | |
| 326 | json_set_err(FSL_JSON_E_DENIED, |
| 327 | "Requires 'i' permissions."); |
| 328 | return NULL; |
| 329 | } |
| 330 | memset(&opt,0,sizeof(BranchCreateOptions)); |
| 331 | if(fossil_is_json()){ |
| 332 | opt.zName = json_getenv_cstr("name"); |
| 333 | } |
| 334 | |
| 335 | if(!opt.zName){ |
| 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 |
| --- src/json_branch.c | |
| +++ src/json_branch.c | |
| @@ -77,11 +77,11 @@ | |
| 77 | } |
| 78 | payV = cson_value_new_object(); |
| 79 | pay = cson_value_get_object(payV); |
| 80 | listV = cson_value_new_array(); |
| 81 | list = cson_value_get_array(listV); |
| 82 | if(fossil_has_json()){ |
| 83 | range = json_getenv_cstr("range"); |
| 84 | } |
| 85 | |
| 86 | range = json_find_option_cstr("range",NULL,"r"); |
| 87 | if((!range||!*range) && !g.isHTTP){ |
| @@ -326,11 +326,11 @@ | |
| 326 | json_set_err(FSL_JSON_E_DENIED, |
| 327 | "Requires 'i' permissions."); |
| 328 | return NULL; |
| 329 | } |
| 330 | memset(&opt,0,sizeof(BranchCreateOptions)); |
| 331 | if(fossil_has_json()){ |
| 332 | opt.zName = json_getenv_cstr("name"); |
| 333 | } |
| 334 | |
| 335 | if(!opt.zName){ |
| 336 | opt.zName = json_command_arg(g.json.dispatchDepth+1); |
| 337 |
+19
| --- src/json_detail.h | ||
| +++ src/json_detail.h | ||
| @@ -227,7 +227,26 @@ | ||
| 227 | 227 | ** time the variadic form was introduced we already had use cases |
| 228 | 228 | ** which segfaulted via json_new_string() because they contain printf |
| 229 | 229 | ** markup (e.g. wiki content). Been there, debugged that. |
| 230 | 230 | */ |
| 231 | 231 | cson_value * json_new_string_f( char const * fmt, ... ); |
| 232 | + | |
| 233 | +/* | |
| 234 | +** Returns true if fossil is running in JSON mode and we are either | |
| 235 | +** running in HTTP mode OR g.json.post.o is not NULL (meaning POST | |
| 236 | +** data was fed in from CLI mode). | |
| 237 | +** | |
| 238 | +** Specifically, it will return false when any of these apply: | |
| 239 | +** | |
| 240 | +** a) Not running in JSON mode (via json command or /json path). | |
| 241 | +** | |
| 242 | +** b) We are running in JSON CLI mode, but no POST data has been fed | |
| 243 | +** in. | |
| 244 | +** | |
| 245 | +** Whether or not we need to take args from CLI or POST data makes a | |
| 246 | +** difference in argument/parameter handling in many JSON rountines, | |
| 247 | +** and thus this distinction. | |
| 248 | +*/ | |
| 249 | +char fossil_has_json(); | |
| 250 | + | |
| 232 | 251 | |
| 233 | 252 | #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/ |
| 234 | 253 |
| --- src/json_detail.h | |
| +++ src/json_detail.h | |
| @@ -227,7 +227,26 @@ | |
| 227 | ** time the variadic form was introduced we already had use cases |
| 228 | ** which segfaulted via json_new_string() because they contain printf |
| 229 | ** markup (e.g. wiki content). Been there, debugged that. |
| 230 | */ |
| 231 | cson_value * json_new_string_f( char const * fmt, ... ); |
| 232 | |
| 233 | #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/ |
| 234 |
| --- src/json_detail.h | |
| +++ src/json_detail.h | |
| @@ -227,7 +227,26 @@ | |
| 227 | ** time the variadic form was introduced we already had use cases |
| 228 | ** which segfaulted via json_new_string() because they contain printf |
| 229 | ** markup (e.g. wiki content). Been there, debugged that. |
| 230 | */ |
| 231 | cson_value * json_new_string_f( char const * fmt, ... ); |
| 232 | |
| 233 | /* |
| 234 | ** Returns true if fossil is running in JSON mode and we are either |
| 235 | ** running in HTTP mode OR g.json.post.o is not NULL (meaning POST |
| 236 | ** data was fed in from CLI mode). |
| 237 | ** |
| 238 | ** Specifically, it will return false when any of these apply: |
| 239 | ** |
| 240 | ** a) Not running in JSON mode (via json command or /json path). |
| 241 | ** |
| 242 | ** b) We are running in JSON CLI mode, but no POST data has been fed |
| 243 | ** in. |
| 244 | ** |
| 245 | ** Whether or not we need to take args from CLI or POST data makes a |
| 246 | ** difference in argument/parameter handling in many JSON rountines, |
| 247 | ** and thus this distinction. |
| 248 | */ |
| 249 | char fossil_has_json(); |
| 250 | |
| 251 | |
| 252 | #endif/*FOSSIL_JSON_DETAIL_H_INCLUDED*/ |
| 253 |
+6
-6
| --- src/json_tag.c | ||
| +++ src/json_tag.c | ||
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 70 | 70 | fPropagate = json_find_option_bool("propagate",NULL,NULL,0); |
| 71 | 71 | zName = json_find_option_cstr("name",NULL,NULL); |
| 72 | 72 | zPrefix = fRaw ? "" : "sym-"; |
| 73 | 73 | if(!zName || !*zName){ |
| 74 | - if(!fossil_is_json()){ | |
| 74 | + if(!fossil_has_json()){ | |
| 75 | 75 | zName = json_command_arg(3); |
| 76 | 76 | } |
| 77 | 77 | if(!zName || !*zName){ |
| 78 | 78 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 79 | 79 | "'name' parameter is missing."); |
| @@ -81,11 +81,11 @@ | ||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 85 | 85 | if( !zCheckin ){ |
| 86 | - if(!fossil_is_json()){ | |
| 86 | + if(!fossil_has_json()){ | |
| 87 | 87 | zCheckin = json_command_arg(4); |
| 88 | 88 | } |
| 89 | 89 | if(!zCheckin || !*zCheckin){ |
| 90 | 90 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 91 | 91 | "'checkin' parameter is missing."); |
| @@ -93,11 +93,11 @@ | ||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 98 | - if(!zValue && !fossil_is_json()){ | |
| 98 | + if(!zValue && !fossil_has_json()){ | |
| 99 | 99 | zValue = json_command_arg(5); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | db_begin_transaction(); |
| 103 | 103 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| @@ -152,11 +152,11 @@ | ||
| 152 | 152 | |
| 153 | 153 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 154 | 154 | zPrefix = fRaw ? "" : "sym-"; |
| 155 | 155 | zName = json_find_option_cstr("name",NULL,NULL); |
| 156 | 156 | if(!zName || !*zName){ |
| 157 | - if(!fossil_is_json()){ | |
| 157 | + if(!fossil_has_json()){ | |
| 158 | 158 | zName = json_command_arg(3); |
| 159 | 159 | } |
| 160 | 160 | if(!zName || !*zName){ |
| 161 | 161 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 162 | 162 | "'name' parameter is missing."); |
| @@ -164,11 +164,11 @@ | ||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 168 | 168 | if( !zCheckin ){ |
| 169 | - if(!fossil_is_json()){ | |
| 169 | + if(!fossil_has_json()){ | |
| 170 | 170 | zCheckin = json_command_arg(4); |
| 171 | 171 | } |
| 172 | 172 | if(!zCheckin || !*zCheckin){ |
| 173 | 173 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 174 | 174 | "'checkin' parameter is missing."); |
| @@ -206,11 +206,11 @@ | ||
| 206 | 206 | "Requires 'o' permissions."); |
| 207 | 207 | return NULL; |
| 208 | 208 | } |
| 209 | 209 | zName = json_find_option_cstr("name",NULL,NULL); |
| 210 | 210 | if(!zName || !*zName){ |
| 211 | - if(!fossil_is_json()){ | |
| 211 | + if(!fossil_has_json()){ | |
| 212 | 212 | zName = json_command_arg(3); |
| 213 | 213 | } |
| 214 | 214 | if(!zName || !*zName){ |
| 215 | 215 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 216 | 216 | "'name' parameter is missing."); |
| 217 | 217 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 70 | fPropagate = json_find_option_bool("propagate",NULL,NULL,0); |
| 71 | zName = json_find_option_cstr("name",NULL,NULL); |
| 72 | zPrefix = fRaw ? "" : "sym-"; |
| 73 | if(!zName || !*zName){ |
| 74 | if(!fossil_is_json()){ |
| 75 | zName = json_command_arg(3); |
| 76 | } |
| 77 | if(!zName || !*zName){ |
| 78 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 79 | "'name' parameter is missing."); |
| @@ -81,11 +81,11 @@ | |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 85 | if( !zCheckin ){ |
| 86 | if(!fossil_is_json()){ |
| 87 | zCheckin = json_command_arg(4); |
| 88 | } |
| 89 | if(!zCheckin || !*zCheckin){ |
| 90 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 91 | "'checkin' parameter is missing."); |
| @@ -93,11 +93,11 @@ | |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | |
| 97 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 98 | if(!zValue && !fossil_is_json()){ |
| 99 | zValue = json_command_arg(5); |
| 100 | } |
| 101 | |
| 102 | db_begin_transaction(); |
| 103 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| @@ -152,11 +152,11 @@ | |
| 152 | |
| 153 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 154 | zPrefix = fRaw ? "" : "sym-"; |
| 155 | zName = json_find_option_cstr("name",NULL,NULL); |
| 156 | if(!zName || !*zName){ |
| 157 | if(!fossil_is_json()){ |
| 158 | zName = json_command_arg(3); |
| 159 | } |
| 160 | if(!zName || !*zName){ |
| 161 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 162 | "'name' parameter is missing."); |
| @@ -164,11 +164,11 @@ | |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 168 | if( !zCheckin ){ |
| 169 | if(!fossil_is_json()){ |
| 170 | zCheckin = json_command_arg(4); |
| 171 | } |
| 172 | if(!zCheckin || !*zCheckin){ |
| 173 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 174 | "'checkin' parameter is missing."); |
| @@ -206,11 +206,11 @@ | |
| 206 | "Requires 'o' permissions."); |
| 207 | return NULL; |
| 208 | } |
| 209 | zName = json_find_option_cstr("name",NULL,NULL); |
| 210 | if(!zName || !*zName){ |
| 211 | if(!fossil_is_json()){ |
| 212 | zName = json_command_arg(3); |
| 213 | } |
| 214 | if(!zName || !*zName){ |
| 215 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 216 | "'name' parameter is missing."); |
| 217 |
| --- src/json_tag.c | |
| +++ src/json_tag.c | |
| @@ -69,11 +69,11 @@ | |
| 69 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 70 | fPropagate = json_find_option_bool("propagate",NULL,NULL,0); |
| 71 | zName = json_find_option_cstr("name",NULL,NULL); |
| 72 | zPrefix = fRaw ? "" : "sym-"; |
| 73 | if(!zName || !*zName){ |
| 74 | if(!fossil_has_json()){ |
| 75 | zName = json_command_arg(3); |
| 76 | } |
| 77 | if(!zName || !*zName){ |
| 78 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 79 | "'name' parameter is missing."); |
| @@ -81,11 +81,11 @@ | |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 85 | if( !zCheckin ){ |
| 86 | if(!fossil_has_json()){ |
| 87 | zCheckin = json_command_arg(4); |
| 88 | } |
| 89 | if(!zCheckin || !*zCheckin){ |
| 90 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 91 | "'checkin' parameter is missing."); |
| @@ -93,11 +93,11 @@ | |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | |
| 97 | zValue = json_find_option_cstr("value",NULL,NULL); |
| 98 | if(!zValue && !fossil_has_json()){ |
| 99 | zValue = json_command_arg(5); |
| 100 | } |
| 101 | |
| 102 | db_begin_transaction(); |
| 103 | tag_add_artifact(zPrefix, zName, zCheckin, zValue, |
| @@ -152,11 +152,11 @@ | |
| 152 | |
| 153 | fRaw = json_find_option_bool("raw",NULL,NULL,0); |
| 154 | zPrefix = fRaw ? "" : "sym-"; |
| 155 | zName = json_find_option_cstr("name",NULL,NULL); |
| 156 | if(!zName || !*zName){ |
| 157 | if(!fossil_has_json()){ |
| 158 | zName = json_command_arg(3); |
| 159 | } |
| 160 | if(!zName || !*zName){ |
| 161 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 162 | "'name' parameter is missing."); |
| @@ -164,11 +164,11 @@ | |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | zCheckin = json_find_option_cstr("checkin",NULL,NULL); |
| 168 | if( !zCheckin ){ |
| 169 | if(!fossil_has_json()){ |
| 170 | zCheckin = json_command_arg(4); |
| 171 | } |
| 172 | if(!zCheckin || !*zCheckin){ |
| 173 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 174 | "'checkin' parameter is missing."); |
| @@ -206,11 +206,11 @@ | |
| 206 | "Requires 'o' permissions."); |
| 207 | return NULL; |
| 208 | } |
| 209 | zName = json_find_option_cstr("name",NULL,NULL); |
| 210 | if(!zName || !*zName){ |
| 211 | if(!fossil_has_json()){ |
| 212 | zName = json_command_arg(3); |
| 213 | } |
| 214 | if(!zName || !*zName){ |
| 215 | json_set_err(FSL_JSON_E_MISSING_ARGS, |
| 216 | "'name' parameter is missing."); |
| 217 |
+1
-1
| --- src/json_timeline.c | ||
| +++ src/json_timeline.c | ||
| @@ -241,11 +241,11 @@ | ||
| 241 | 241 | char const * arg = find_option("limit","n",1); |
| 242 | 242 | if(arg && *arg){ |
| 243 | 243 | limit = atoi(arg); |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | - if( (limit<0) && fossil_is_json() ){ | |
| 246 | + if( (limit<0) && fossil_has_json() ){ | |
| 247 | 247 | limit = json_getenv_int("limit",-1); |
| 248 | 248 | } |
| 249 | 249 | return (limit<0) ? defaultLimit : limit; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -241,11 +241,11 @@ | |
| 241 | char const * arg = find_option("limit","n",1); |
| 242 | if(arg && *arg){ |
| 243 | limit = atoi(arg); |
| 244 | } |
| 245 | } |
| 246 | if( (limit<0) && fossil_is_json() ){ |
| 247 | limit = json_getenv_int("limit",-1); |
| 248 | } |
| 249 | return (limit<0) ? defaultLimit : limit; |
| 250 | } |
| 251 | |
| 252 |
| --- src/json_timeline.c | |
| +++ src/json_timeline.c | |
| @@ -241,11 +241,11 @@ | |
| 241 | char const * arg = find_option("limit","n",1); |
| 242 | if(arg && *arg){ |
| 243 | limit = atoi(arg); |
| 244 | } |
| 245 | } |
| 246 | if( (limit<0) && fossil_has_json() ){ |
| 247 | limit = json_getenv_int("limit",-1); |
| 248 | } |
| 249 | return (limit<0) ? defaultLimit : limit; |
| 250 | } |
| 251 | |
| 252 |
+1
-1
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -366,11 +366,11 @@ | ||
| 366 | 366 | int name_to_rid_www(const char *zParamName){ |
| 367 | 367 | int i, rc; |
| 368 | 368 | int rid; |
| 369 | 369 | const char *zName = P(zParamName); |
| 370 | 370 | Blob name; |
| 371 | - if(!zName && fossil_is_json()){ | |
| 371 | + if(!zName && fossil_has_json()){ | |
| 372 | 372 | zName = json_find_option_cstr(zParamName,NULL,NULL); |
| 373 | 373 | } |
| 374 | 374 | if( zName==0 || zName[0]==0 ) return 0; |
| 375 | 375 | blob_init(&name, zName, -1); |
| 376 | 376 | rc = name_to_uuid(&name, -1, "*"); |
| 377 | 377 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -366,11 +366,11 @@ | |
| 366 | int name_to_rid_www(const char *zParamName){ |
| 367 | int i, rc; |
| 368 | int rid; |
| 369 | const char *zName = P(zParamName); |
| 370 | Blob name; |
| 371 | if(!zName && fossil_is_json()){ |
| 372 | zName = json_find_option_cstr(zParamName,NULL,NULL); |
| 373 | } |
| 374 | if( zName==0 || zName[0]==0 ) return 0; |
| 375 | blob_init(&name, zName, -1); |
| 376 | rc = name_to_uuid(&name, -1, "*"); |
| 377 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -366,11 +366,11 @@ | |
| 366 | int name_to_rid_www(const char *zParamName){ |
| 367 | int i, rc; |
| 368 | int rid; |
| 369 | const char *zName = P(zParamName); |
| 370 | Blob name; |
| 371 | if(!zName && fossil_has_json()){ |
| 372 | zName = json_find_option_cstr(zParamName,NULL,NULL); |
| 373 | } |
| 374 | if( zName==0 || zName[0]==0 ) return 0; |
| 375 | blob_init(&name, zName, -1); |
| 376 | rc = name_to_uuid(&name, -1, "*"); |
| 377 |