Fossil SCM

Merge the steveb-fixes branch into trunk.

drh 2011-11-04 19:10 trunk merge
Commit aeec10b900ef540ad9d18091af01ee21a620735f
2 files changed +5 -3 +1
+5 -3
--- src/th_main.c
+++ src/th_main.c
@@ -482,25 +482,27 @@
482482
Th_FossilInit();
483483
while( z[i] ){
484484
if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){
485485
const char *zVar;
486486
int nVar;
487
+ int encode = 1;
487488
sendText(z, i, 0);
488489
if( z[i+1]=='<' ){
489
- /* Variables of the form $<aaa> */
490
+ /* Variables of the form $<aaa> are html escaped */
490491
zVar = &z[i+2];
491492
nVar = n-2;
492493
}else{
493
- /* Variables of the form $aaa */
494
+ /* Variables of the form $aaa are output raw */
494495
zVar = &z[i+1];
495496
nVar = n;
497
+ encode = 0;
496498
}
497499
rc = Th_GetVar(g.interp, (char*)zVar, nVar);
498500
z += i+1+n;
499501
i = 0;
500502
zResult = (char*)Th_GetResult(g.interp, &n);
501
- sendText((char*)zResult, n, n>nVar);
503
+ sendText((char*)zResult, n, encode);
502504
}else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
503505
sendText(z, i, 0);
504506
z += i+5;
505507
for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
506508
rc = Th_Eval(g.interp, 0, (const char*)z, i);
507509
--- src/th_main.c
+++ src/th_main.c
@@ -482,25 +482,27 @@
482 Th_FossilInit();
483 while( z[i] ){
484 if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){
485 const char *zVar;
486 int nVar;
 
487 sendText(z, i, 0);
488 if( z[i+1]=='<' ){
489 /* Variables of the form $<aaa> */
490 zVar = &z[i+2];
491 nVar = n-2;
492 }else{
493 /* Variables of the form $aaa */
494 zVar = &z[i+1];
495 nVar = n;
 
496 }
497 rc = Th_GetVar(g.interp, (char*)zVar, nVar);
498 z += i+1+n;
499 i = 0;
500 zResult = (char*)Th_GetResult(g.interp, &n);
501 sendText((char*)zResult, n, n>nVar);
502 }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
503 sendText(z, i, 0);
504 z += i+5;
505 for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
506 rc = Th_Eval(g.interp, 0, (const char*)z, i);
507
--- src/th_main.c
+++ src/th_main.c
@@ -482,25 +482,27 @@
482 Th_FossilInit();
483 while( z[i] ){
484 if( z[i]=='$' && (n = validVarName(&z[i+1]))>0 ){
485 const char *zVar;
486 int nVar;
487 int encode = 1;
488 sendText(z, i, 0);
489 if( z[i+1]=='<' ){
490 /* Variables of the form $<aaa> are html escaped */
491 zVar = &z[i+2];
492 nVar = n-2;
493 }else{
494 /* Variables of the form $aaa are output raw */
495 zVar = &z[i+1];
496 nVar = n;
497 encode = 0;
498 }
499 rc = Th_GetVar(g.interp, (char*)zVar, nVar);
500 z += i+1+n;
501 i = 0;
502 zResult = (char*)Th_GetResult(g.interp, &n);
503 sendText((char*)zResult, n, encode);
504 }else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
505 sendText(z, i, 0);
506 z += i+5;
507 for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
508 rc = Th_Eval(g.interp, 0, (const char*)z, i);
509
--- src/translate.c
+++ src/translate.c
@@ -165,10 +165,11 @@
165165
FILE *in = fopen(argv[1], "r");
166166
if( in==0 ){
167167
fprintf(stderr,"can not open %s\n", argv[1]);
168168
exit(1);
169169
}
170
+ printf("#line 1 \"%s\"\n", argv[1]);
170171
trans(in, stdout);
171172
fclose(in);
172173
}else{
173174
trans(stdin, stdout);
174175
}
175176
--- src/translate.c
+++ src/translate.c
@@ -165,10 +165,11 @@
165 FILE *in = fopen(argv[1], "r");
166 if( in==0 ){
167 fprintf(stderr,"can not open %s\n", argv[1]);
168 exit(1);
169 }
 
170 trans(in, stdout);
171 fclose(in);
172 }else{
173 trans(stdin, stdout);
174 }
175
--- src/translate.c
+++ src/translate.c
@@ -165,10 +165,11 @@
165 FILE *in = fopen(argv[1], "r");
166 if( in==0 ){
167 fprintf(stderr,"can not open %s\n", argv[1]);
168 exit(1);
169 }
170 printf("#line 1 \"%s\"\n", argv[1]);
171 trans(in, stdout);
172 fclose(in);
173 }else{
174 trans(stdin, stdout);
175 }
176

Keyboard Shortcuts

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