Fossil SCM

Merge trunk

andygoth 2016-11-05 06:42 andygoth-timeline-ms merge
Commit 4630d9ba8b04e49884d819a88c2b3e24b6043241
+13 -4
--- src/printf.c
+++ src/printf.c
@@ -875,24 +875,33 @@
875875
/*
876876
** Write to standard output or standard error.
877877
**
878878
** On windows, transform the output into the current terminal encoding
879879
** if the output is going to the screen. If output is redirected into
880
-** a file, no translation occurs. No translation ever occurs on unix.
880
+** a file, no translation occurs. Switch output mode to binary to
881
+** properly process line-endings, make sure to switch the mode back to
882
+** text when done.
883
+** No translation ever occurs on unix.
881884
*/
882885
void fossil_puts(const char *z, int toStdErr){
886
+ FILE* out = (toStdErr ? stderr : stdout);
883887
int n = (int)strlen(z);
884888
if( n==0 ) return;
889
+ assert( toStdErr==0 || toStdErr==1 );
885890
if( toStdErr==0 ) stdoutAtBOL = (z[n-1]=='\n');
886891
#if defined(_WIN32)
887892
if( fossil_utf8_to_console(z, n, toStdErr) >= 0 ){
888893
return;
889894
}
895
+ fflush(out);
896
+ _setmode(_fileno(out), _O_BINARY);
890897
#endif
891
- assert( toStdErr==0 || toStdErr==1 );
892
- fwrite(z, 1, n, toStdErr ? stderr : stdout);
893
- fflush(toStdErr ? stderr : stdout);
898
+ fwrite(z, 1, n, out);
899
+#if defined(_WIN32)
900
+ fflush(out);
901
+ _setmode(_fileno(out), _O_TEXT);
902
+#endif
894903
}
895904
896905
/*
897906
** Force the standard output cursor to move to the beginning
898907
** of a line, if it is not there already.
899908
--- src/printf.c
+++ src/printf.c
@@ -875,24 +875,33 @@
875 /*
876 ** Write to standard output or standard error.
877 **
878 ** On windows, transform the output into the current terminal encoding
879 ** if the output is going to the screen. If output is redirected into
880 ** a file, no translation occurs. No translation ever occurs on unix.
 
 
 
881 */
882 void fossil_puts(const char *z, int toStdErr){
 
883 int n = (int)strlen(z);
884 if( n==0 ) return;
 
885 if( toStdErr==0 ) stdoutAtBOL = (z[n-1]=='\n');
886 #if defined(_WIN32)
887 if( fossil_utf8_to_console(z, n, toStdErr) >= 0 ){
888 return;
889 }
 
 
890 #endif
891 assert( toStdErr==0 || toStdErr==1 );
892 fwrite(z, 1, n, toStdErr ? stderr : stdout);
893 fflush(toStdErr ? stderr : stdout);
 
 
894 }
895
896 /*
897 ** Force the standard output cursor to move to the beginning
898 ** of a line, if it is not there already.
899
--- src/printf.c
+++ src/printf.c
@@ -875,24 +875,33 @@
875 /*
876 ** Write to standard output or standard error.
877 **
878 ** On windows, transform the output into the current terminal encoding
879 ** if the output is going to the screen. If output is redirected into
880 ** a file, no translation occurs. Switch output mode to binary to
881 ** properly process line-endings, make sure to switch the mode back to
882 ** text when done.
883 ** No translation ever occurs on unix.
884 */
885 void fossil_puts(const char *z, int toStdErr){
886 FILE* out = (toStdErr ? stderr : stdout);
887 int n = (int)strlen(z);
888 if( n==0 ) return;
889 assert( toStdErr==0 || toStdErr==1 );
890 if( toStdErr==0 ) stdoutAtBOL = (z[n-1]=='\n');
891 #if defined(_WIN32)
892 if( fossil_utf8_to_console(z, n, toStdErr) >= 0 ){
893 return;
894 }
895 fflush(out);
896 _setmode(_fileno(out), _O_BINARY);
897 #endif
898 fwrite(z, 1, n, out);
899 #if defined(_WIN32)
900 fflush(out);
901 _setmode(_fileno(out), _O_TEXT);
902 #endif
903 }
904
905 /*
906 ** Force the standard output cursor to move to the beginning
907 ** of a line, if it is not there already.
908
+36 -42
--- src/style.c
+++ src/style.c
@@ -545,72 +545,65 @@
545545
zDisabled = "";
546546
cgi_tag_query_parameter(zQPN);
547547
}
548548
switch( aSubmenuCtrl[i].eType ){
549549
case FF_ENTRY:
550
- cgi_printf(
551
- "<span class='submenuctrl'>"
552
- "&nbsp;%h<input type='text' name='%s' value='%h'%s",
553
- aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled
554
- );
550
+ @ <span class='submenuctrl'>\
551
+ @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
552
+ @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
555553
if( aSubmenuCtrl[i].iSize<0 ){
556
- cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize);
554
+ @ size='%d(-aSubmenuCtrl[i].iSize)' \
557555
}else if( aSubmenuCtrl[i].iSize>0 ){
558
- cgi_printf(
559
- " size='%d' maxlength='%d'",
560
- aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize
561
- );
556
+ @ size='%d(aSubmenuCtrl[i].iSize)' \
557
+ @ maxlength='%d(aSubmenuCtrl[i].iSize)' \
562558
}
563
- @ onchange='gebi("f01").submit();'></span>
559
+ @ onchange='gebi("f01").submit();'%s(zDisabled)></span>
564560
break;
565561
case FF_MULTI: {
566562
int j;
567563
const char *zVal = P(zQPN);
568564
if( aSubmenuCtrl[i].zLabel ){
569
- cgi_printf("&nbsp;%h", aSubmenuCtrl[i].zLabel);
565
+ @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
570566
}
571
- cgi_printf(
572
- "<select class='submenuctrl' size='1' name='%s'%s "
573
- "onchange='gebi(\"f01\").submit();'>\n",
574
- zQPN, zDisabled
575
- );
567
+ @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
568
+ @ onchange='gebi("f01").submit();'%s(zDisabled)>
576569
for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
577570
const char *zQPV = aSubmenuCtrl[i].azChoice[j];
578
- cgi_printf(
579
- "<option value='%h'%s>%h</option>\n",
580
- zQPV,
581
- fossil_strcmp(zVal,zQPV)==0 ? " selected" : "",
582
- aSubmenuCtrl[i].azChoice[j+1]
583
- );
571
+ @ <option value='%h(zQPV)'\
572
+ if( fossil_strcmp(zVal, zQPV)==0 ){
573
+ @ selected\
574
+ }
575
+ @ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
584576
}
585577
@ </select>
586578
break;
587579
}
588580
case FF_BINARY: {
589581
int isTrue = PB(zQPN);
590
- cgi_printf(
591
- "<select class='submenuctrl' size='1' name='%s'%s "
592
- "onchange='gebi(\"f01\").submit();'>\n",
593
- zQPN, zDisabled
594
- );
595
- cgi_printf(
596
- "<option value='1'%s>%h</option>\n",
597
- isTrue ? " selected":"", aSubmenuCtrl[i].zLabel
598
- );
599
- cgi_printf(
600
- "<option value='0'%s>%h</option>\n",
601
- (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse
602
- );
582
+ @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
583
+ @ onchange='gebi("f01").submit();'%s(zDisabled)>
584
+ @ <option value='1'\
585
+ if( isTrue ){
586
+ @ selected\
587
+ }
588
+ @ >%h(aSubmenuCtrl[i].zLabel)</option>
589
+ @ <option value='0'\
590
+ if( !isTrue ){
591
+ @ selected\
592
+ }
593
+ @ >%h(aSubmenuCtrl[i].zFalse)</option>
603594
@ </select>
604595
break;
605596
}
606597
case FF_CHECKBOX:
607
- cgi_printf(
608
- "<label class='submenuctrl'><input type='checkbox' name='%s' "
609
- "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n",
610
- zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel
611
- );
598
+ @ <label class='submenuctrl'>\
599
+ @ <input type='checkbox' name='%s(zQPN)' value='1' \
600
+ if( PB(zQPN) ){
601
+ @ checked \
602
+ }
603
+ @ onchange='gebi("f01").submit();'%s(zDisabled)>\
604
+ @ %h(aSubmenuCtrl[i].zLabel)</label>
612605
break;
613606
}
614607
}
615608
@ </div>
616609
if( nSubmenuCtrl ){
@@ -724,14 +717,15 @@
724717
{ "td.timelineTableCell",
725718
"the format for the timeline data cells",
726719
@ vertical-align: top;
727720
@ text-align: left;
728721
},
729
- { "tr.timelineCurrent td.timelineTableCell",
722
+ { "tr.timelineCurrent",
730723
"the format for the timeline data cell of the current checkout",
731724
@ padding: .1em .2em;
732725
@ border: 1px dashed #446979;
726
+ @ box-shadow: 1px 1px 4px #888;
733727
},
734728
{ "tr.timelineSelected",
735729
"The row in the timeline table that contains the entry of interest",
736730
@ padding: .1em .2em;
737731
@ border: 2px solid lightgray;
738732
--- src/style.c
+++ src/style.c
@@ -545,72 +545,65 @@
545 zDisabled = "";
546 cgi_tag_query_parameter(zQPN);
547 }
548 switch( aSubmenuCtrl[i].eType ){
549 case FF_ENTRY:
550 cgi_printf(
551 "<span class='submenuctrl'>"
552 "&nbsp;%h<input type='text' name='%s' value='%h'%s",
553 aSubmenuCtrl[i].zLabel, zQPN, PD(zQPN, ""), zDisabled
554 );
555 if( aSubmenuCtrl[i].iSize<0 ){
556 cgi_printf(" size='%d'", -aSubmenuCtrl[i].iSize);
557 }else if( aSubmenuCtrl[i].iSize>0 ){
558 cgi_printf(
559 " size='%d' maxlength='%d'",
560 aSubmenuCtrl[i].iSize, aSubmenuCtrl[i].iSize
561 );
562 }
563 @ onchange='gebi("f01").submit();'></span>
564 break;
565 case FF_MULTI: {
566 int j;
567 const char *zVal = P(zQPN);
568 if( aSubmenuCtrl[i].zLabel ){
569 cgi_printf("&nbsp;%h", aSubmenuCtrl[i].zLabel);
570 }
571 cgi_printf(
572 "<select class='submenuctrl' size='1' name='%s'%s "
573 "onchange='gebi(\"f01\").submit();'>\n",
574 zQPN, zDisabled
575 );
576 for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
577 const char *zQPV = aSubmenuCtrl[i].azChoice[j];
578 cgi_printf(
579 "<option value='%h'%s>%h</option>\n",
580 zQPV,
581 fossil_strcmp(zVal,zQPV)==0 ? " selected" : "",
582 aSubmenuCtrl[i].azChoice[j+1]
583 );
584 }
585 @ </select>
586 break;
587 }
588 case FF_BINARY: {
589 int isTrue = PB(zQPN);
590 cgi_printf(
591 "<select class='submenuctrl' size='1' name='%s'%s "
592 "onchange='gebi(\"f01\").submit();'>\n",
593 zQPN, zDisabled
594 );
595 cgi_printf(
596 "<option value='1'%s>%h</option>\n",
597 isTrue ? " selected":"", aSubmenuCtrl[i].zLabel
598 );
599 cgi_printf(
600 "<option value='0'%s>%h</option>\n",
601 (!isTrue) ? " selected":"", aSubmenuCtrl[i].zFalse
602 );
603 @ </select>
604 break;
605 }
606 case FF_CHECKBOX:
607 cgi_printf(
608 "<label class='submenuctrl'><input type='checkbox' name='%s' "
609 "value='1'%s%s onchange='gebi(\"f01\").submit();'>%s</label>\n",
610 zQPN, PB(zQPN) ? " checked" : "", zDisabled, aSubmenuCtrl[i].zLabel
611 );
 
 
612 break;
613 }
614 }
615 @ </div>
616 if( nSubmenuCtrl ){
@@ -724,14 +717,15 @@
724 { "td.timelineTableCell",
725 "the format for the timeline data cells",
726 @ vertical-align: top;
727 @ text-align: left;
728 },
729 { "tr.timelineCurrent td.timelineTableCell",
730 "the format for the timeline data cell of the current checkout",
731 @ padding: .1em .2em;
732 @ border: 1px dashed #446979;
 
733 },
734 { "tr.timelineSelected",
735 "The row in the timeline table that contains the entry of interest",
736 @ padding: .1em .2em;
737 @ border: 2px solid lightgray;
738
--- src/style.c
+++ src/style.c
@@ -545,72 +545,65 @@
545 zDisabled = "";
546 cgi_tag_query_parameter(zQPN);
547 }
548 switch( aSubmenuCtrl[i].eType ){
549 case FF_ENTRY:
550 @ <span class='submenuctrl'>\
551 @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
552 @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
 
 
553 if( aSubmenuCtrl[i].iSize<0 ){
554 @ size='%d(-aSubmenuCtrl[i].iSize)' \
555 }else if( aSubmenuCtrl[i].iSize>0 ){
556 @ size='%d(aSubmenuCtrl[i].iSize)' \
557 @ maxlength='%d(aSubmenuCtrl[i].iSize)' \
 
 
558 }
559 @ onchange='gebi("f01").submit();'%s(zDisabled)></span>
560 break;
561 case FF_MULTI: {
562 int j;
563 const char *zVal = P(zQPN);
564 if( aSubmenuCtrl[i].zLabel ){
565 @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
566 }
567 @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
568 @ onchange='gebi("f01").submit();'%s(zDisabled)>
 
 
 
569 for(j=0; j<aSubmenuCtrl[i].iSize*2; j+=2){
570 const char *zQPV = aSubmenuCtrl[i].azChoice[j];
571 @ <option value='%h(zQPV)'\
572 if( fossil_strcmp(zVal, zQPV)==0 ){
573 @ selected\
574 }
575 @ >%h(aSubmenuCtrl[i].azChoice[j+1])</option>
 
576 }
577 @ </select>
578 break;
579 }
580 case FF_BINARY: {
581 int isTrue = PB(zQPN);
582 @ <select class='submenuctrl' size='1' name='%s(zQPN)' \
583 @ onchange='gebi("f01").submit();'%s(zDisabled)>
584 @ <option value='1'\
585 if( isTrue ){
586 @ selected\
587 }
588 @ >%h(aSubmenuCtrl[i].zLabel)</option>
589 @ <option value='0'\
590 if( !isTrue ){
591 @ selected\
592 }
593 @ >%h(aSubmenuCtrl[i].zFalse)</option>
 
594 @ </select>
595 break;
596 }
597 case FF_CHECKBOX:
598 @ <label class='submenuctrl'>\
599 @ <input type='checkbox' name='%s(zQPN)' value='1' \
600 if( PB(zQPN) ){
601 @ checked \
602 }
603 @ onchange='gebi("f01").submit();'%s(zDisabled)>\
604 @ %h(aSubmenuCtrl[i].zLabel)</label>
605 break;
606 }
607 }
608 @ </div>
609 if( nSubmenuCtrl ){
@@ -724,14 +717,15 @@
717 { "td.timelineTableCell",
718 "the format for the timeline data cells",
719 @ vertical-align: top;
720 @ text-align: left;
721 },
722 { "tr.timelineCurrent",
723 "the format for the timeline data cell of the current checkout",
724 @ padding: .1em .2em;
725 @ border: 1px dashed #446979;
726 @ box-shadow: 1px 1px 4px #888;
727 },
728 { "tr.timelineSelected",
729 "The row in the timeline table that contains the entry of interest",
730 @ padding: .1em .2em;
731 @ border: 2px solid lightgray;
732
+13 -2
--- src/translate.c
+++ src/translate.c
@@ -46,10 +46,15 @@
4646
** cause CC to become a comment character for the @-substitution.
4747
** Typical values for CC are "--" (for SQL text) or "#" (for Tcl script)
4848
** or "//" (for C++ code). Lines of subsequent @-blocks that begin with
4949
** CC are omitted from the output.
5050
**
51
+** Enhancement #3:
52
+**
53
+** If a non-enhancement #1 line ends in backslash, the backslash and the
54
+** newline (\n) are not included in the argument to cgi_printf(). This
55
+** is used to split one long output line across multiple source lines.
5156
*/
5257
#include <stdio.h>
5358
#include <ctype.h>
5459
#include <stdlib.h>
5560
#include <string.h>
@@ -141,17 +146,23 @@
141146
** a cgi_printf() statement whose format is the text following the '@'.
142147
** Substrings of the form "%C(...)" (where C is any sequence of
143148
** characters other than \000 and '(') will put "%C" in the
144149
** format and add the "(...)" as an argument to the cgi_printf call.
145150
*/
151
+ const char *zNewline = "\\n";
146152
int indent;
147153
int nC;
148154
char c;
149155
i++;
150156
if( isspace(zLine[i]) ){ i++; }
151157
indent = i;
152158
for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){
159
+ if( zLine[i]=='\\' && (!zLine[i+1] || zLine[i+1]=='\r'
160
+ || zLine[i+1]=='\n') ){
161
+ zNewline = "";
162
+ break;
163
+ }
153164
if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; }
154165
zOut[j++] = zLine[i];
155166
if( zLine[i]!='%' || zLine[i+1]=='%' || zLine[i+1]==0 ) continue;
156167
for(nC=1; zLine[i+nC] && zLine[i+nC]!='('; nC++){}
157168
if( zLine[i+nC]!='(' || !isalpha(zLine[i+nC-1]) ) continue;
@@ -169,14 +180,14 @@
169180
i++;
170181
}
171182
}
172183
zOut[j] = 0;
173184
if( !inPrint ){
174
- fprintf(out,"%*scgi_printf(\"%s\\n\"",indent-2,"", zOut);
185
+ fprintf(out,"%*scgi_printf(\"%s%s\"",indent-2,"", zOut, zNewline);
175186
inPrint = 1;
176187
}else{
177
- fprintf(out,"\n%*s\"%s\\n\"",indent+5, "", zOut);
188
+ fprintf(out,"\n%*s\"%s%s\"",indent+5, "", zOut, zNewline);
178189
}
179190
}
180191
}
181192
}
182193
183194
--- src/translate.c
+++ src/translate.c
@@ -46,10 +46,15 @@
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 #include <string.h>
@@ -141,17 +146,23 @@
141 ** a cgi_printf() statement whose format is the text following the '@'.
142 ** Substrings of the form "%C(...)" (where C is any sequence of
143 ** characters other than \000 and '(') will put "%C" in the
144 ** format and add the "(...)" as an argument to the cgi_printf call.
145 */
 
146 int indent;
147 int nC;
148 char c;
149 i++;
150 if( isspace(zLine[i]) ){ i++; }
151 indent = i;
152 for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){
 
 
 
 
 
153 if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; }
154 zOut[j++] = zLine[i];
155 if( zLine[i]!='%' || zLine[i+1]=='%' || zLine[i+1]==0 ) continue;
156 for(nC=1; zLine[i+nC] && zLine[i+nC]!='('; nC++){}
157 if( zLine[i+nC]!='(' || !isalpha(zLine[i+nC-1]) ) continue;
@@ -169,14 +180,14 @@
169 i++;
170 }
171 }
172 zOut[j] = 0;
173 if( !inPrint ){
174 fprintf(out,"%*scgi_printf(\"%s\\n\"",indent-2,"", zOut);
175 inPrint = 1;
176 }else{
177 fprintf(out,"\n%*s\"%s\\n\"",indent+5, "", zOut);
178 }
179 }
180 }
181 }
182
183
--- src/translate.c
+++ src/translate.c
@@ -46,10 +46,15 @@
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 ** Enhancement #3:
52 **
53 ** If a non-enhancement #1 line ends in backslash, the backslash and the
54 ** newline (\n) are not included in the argument to cgi_printf(). This
55 ** is used to split one long output line across multiple source lines.
56 */
57 #include <stdio.h>
58 #include <ctype.h>
59 #include <stdlib.h>
60 #include <string.h>
@@ -141,17 +146,23 @@
146 ** a cgi_printf() statement whose format is the text following the '@'.
147 ** Substrings of the form "%C(...)" (where C is any sequence of
148 ** characters other than \000 and '(') will put "%C" in the
149 ** format and add the "(...)" as an argument to the cgi_printf call.
150 */
151 const char *zNewline = "\\n";
152 int indent;
153 int nC;
154 char c;
155 i++;
156 if( isspace(zLine[i]) ){ i++; }
157 indent = i;
158 for(j=0; zLine[i] && zLine[i]!='\r' && zLine[i]!='\n'; i++){
159 if( zLine[i]=='\\' && (!zLine[i+1] || zLine[i+1]=='\r'
160 || zLine[i+1]=='\n') ){
161 zNewline = "";
162 break;
163 }
164 if( zLine[i]=='"' || zLine[i]=='\\' ){ zOut[j++] = '\\'; }
165 zOut[j++] = zLine[i];
166 if( zLine[i]!='%' || zLine[i+1]=='%' || zLine[i+1]==0 ) continue;
167 for(nC=1; zLine[i+nC] && zLine[i+nC]!='('; nC++){}
168 if( zLine[i+nC]!='(' || !isalpha(zLine[i+nC-1]) ) continue;
@@ -169,14 +180,14 @@
180 i++;
181 }
182 }
183 zOut[j] = 0;
184 if( !inPrint ){
185 fprintf(out,"%*scgi_printf(\"%s%s\"",indent-2,"", zOut, zNewline);
186 inPrint = 1;
187 }else{
188 fprintf(out,"\n%*s\"%s%s\"",indent+5, "", zOut, zNewline);
189 }
190 }
191 }
192 }
193
194
+1
--- src/utf8.c
+++ src/utf8.c
@@ -317,10 +317,11 @@
317317
wchar_t *zUnicode; /* Unicode version of zUtf8 */
318318
DWORD dummy;
319319
Blob blob;
320320
321321
static int istty[2] = { -1, -1 };
322
+ assert( toStdErr==0 || toStdErr==1 );
322323
if( istty[toStdErr]==-1 ){
323324
istty[toStdErr] = _isatty(toStdErr + 1) != 0;
324325
}
325326
if( !istty[toStdErr] ){
326327
/* stdout/stderr is not a console. */
327328
--- src/utf8.c
+++ src/utf8.c
@@ -317,10 +317,11 @@
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
321 static int istty[2] = { -1, -1 };
 
322 if( istty[toStdErr]==-1 ){
323 istty[toStdErr] = _isatty(toStdErr + 1) != 0;
324 }
325 if( !istty[toStdErr] ){
326 /* stdout/stderr is not a console. */
327
--- src/utf8.c
+++ src/utf8.c
@@ -317,10 +317,11 @@
317 wchar_t *zUnicode; /* Unicode version of zUtf8 */
318 DWORD dummy;
319 Blob blob;
320
321 static int istty[2] = { -1, -1 };
322 assert( toStdErr==0 || toStdErr==1 );
323 if( istty[toStdErr]==-1 ){
324 istty[toStdErr] = _isatty(toStdErr + 1) != 0;
325 }
326 if( !istty[toStdErr] ){
327 /* stdout/stderr is not a console. */
328

Keyboard Shortcuts

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