Fossil SCM

Revise TH1 proc_command fix from the previous check-in so it more closely matches the original fix from [f2d87242503d7a7d].

mistachkin 2015-11-21 18:37 trunk
Commit c66083eded992cc24e842cd133bfb47c95f638d9
1 file changed +5 -4
+5 -4
--- src/th_lang.c
+++ src/th_lang.c
@@ -495,14 +495,15 @@
495495
496496
/* If the last parameter in the parameter list is "args", then set the
497497
** ProcDefn.hasArgs flag. The "args" parameter does not require an
498498
** entry in the ProcDefn.azParam[] or ProcDefn.azDefault[] arrays.
499499
*/
500
- if( nParam
501
- && anParam[nParam-1]==4 && 0==memcmp(azParam[nParam-1], "args", 4) ){
502
- p->hasArgs = 1;
503
- nParam--;
500
+ if( nParam>0 ){
501
+ if( anParam[nParam-1]==4 && 0==memcmp(azParam[nParam-1], "args", 4) ){
502
+ p->hasArgs = 1;
503
+ nParam--;
504
+ }
504505
}
505506
506507
p->nParam = nParam;
507508
p->azParam = (char **)&p[1];
508509
p->anParam = (int *)&p->azParam[nParam];
509510
--- src/th_lang.c
+++ src/th_lang.c
@@ -495,14 +495,15 @@
495
496 /* If the last parameter in the parameter list is "args", then set the
497 ** ProcDefn.hasArgs flag. The "args" parameter does not require an
498 ** entry in the ProcDefn.azParam[] or ProcDefn.azDefault[] arrays.
499 */
500 if( nParam
501 && anParam[nParam-1]==4 && 0==memcmp(azParam[nParam-1], "args", 4) ){
502 p->hasArgs = 1;
503 nParam--;
 
504 }
505
506 p->nParam = nParam;
507 p->azParam = (char **)&p[1];
508 p->anParam = (int *)&p->azParam[nParam];
509
--- src/th_lang.c
+++ src/th_lang.c
@@ -495,14 +495,15 @@
495
496 /* If the last parameter in the parameter list is "args", then set the
497 ** ProcDefn.hasArgs flag. The "args" parameter does not require an
498 ** entry in the ProcDefn.azParam[] or ProcDefn.azDefault[] arrays.
499 */
500 if( nParam>0 ){
501 if( anParam[nParam-1]==4 && 0==memcmp(azParam[nParam-1], "args", 4) ){
502 p->hasArgs = 1;
503 nParam--;
504 }
505 }
506
507 p->nParam = nParam;
508 p->azParam = (char **)&p[1];
509 p->anParam = (int *)&p->azParam[nParam];
510

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button