Fossil SCM

Even more style improvements.

mistachkin 2014-06-19 02:39 respectformatting
Commit c7c3d99a6081d76bc528b61948a668437a633185
1 file changed +3 -5
+3 -5
--- src/comformat.c
+++ src/comformat.c
@@ -44,14 +44,12 @@
4444
**
4545
** Return the number of newlines that are output.
4646
*/
4747
int comment_print(const char *zText, int indent, int lineLength){
4848
int tlen = lineLength - indent;
49
- int len = 0;
50
- int doIndent = 0;
49
+ int len = 0, doIndent = 0, lineCnt = 0;
5150
const char *zBuf;
52
- int lineCnt = 0;
5351
5452
#if defined(_WIN32)
5553
if( lineLength<0 ){
5654
CONSOLE_SCREEN_BUFFER_INFO csbi;
5755
memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO));
@@ -81,13 +79,13 @@
8179
if( tlen<=0 ){
8280
tlen = strlen(zText);
8381
}
8482
while( fossil_isspace(zText[0]) ){ zText++; }
8583
if( zText[0]==0 ){
86
- if( doIndent==0 ){
84
+ if( !doIndent ){
8785
fossil_print("\n");
88
- lineCnt = 1;
86
+ lineCnt++;
8987
}
9088
return lineCnt;
9189
}
9290
zBuf = zText;
9391
for(;;){
9492
--- src/comformat.c
+++ src/comformat.c
@@ -44,14 +44,12 @@
44 **
45 ** Return the number of newlines that are output.
46 */
47 int comment_print(const char *zText, int indent, int lineLength){
48 int tlen = lineLength - indent;
49 int len = 0;
50 int doIndent = 0;
51 const char *zBuf;
52 int lineCnt = 0;
53
54 #if defined(_WIN32)
55 if( lineLength<0 ){
56 CONSOLE_SCREEN_BUFFER_INFO csbi;
57 memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO));
@@ -81,13 +79,13 @@
81 if( tlen<=0 ){
82 tlen = strlen(zText);
83 }
84 while( fossil_isspace(zText[0]) ){ zText++; }
85 if( zText[0]==0 ){
86 if( doIndent==0 ){
87 fossil_print("\n");
88 lineCnt = 1;
89 }
90 return lineCnt;
91 }
92 zBuf = zText;
93 for(;;){
94
--- src/comformat.c
+++ src/comformat.c
@@ -44,14 +44,12 @@
44 **
45 ** Return the number of newlines that are output.
46 */
47 int comment_print(const char *zText, int indent, int lineLength){
48 int tlen = lineLength - indent;
49 int len = 0, doIndent = 0, lineCnt = 0;
 
50 const char *zBuf;
 
51
52 #if defined(_WIN32)
53 if( lineLength<0 ){
54 CONSOLE_SCREEN_BUFFER_INFO csbi;
55 memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO));
@@ -81,13 +79,13 @@
79 if( tlen<=0 ){
80 tlen = strlen(zText);
81 }
82 while( fossil_isspace(zText[0]) ){ zText++; }
83 if( zText[0]==0 ){
84 if( !doIndent ){
85 fossil_print("\n");
86 lineCnt++;
87 }
88 return lineCnt;
89 }
90 zBuf = zText;
91 for(;;){
92

Keyboard Shortcuts

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