Fossil SCM
Even more style improvements.
Commit
c7c3d99a6081d76bc528b61948a668437a633185
Parent
504b0ae0809e721…
1 file changed
+3
-5
+3
-5
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -44,14 +44,12 @@ | ||
| 44 | 44 | ** |
| 45 | 45 | ** Return the number of newlines that are output. |
| 46 | 46 | */ |
| 47 | 47 | int comment_print(const char *zText, int indent, int lineLength){ |
| 48 | 48 | int tlen = lineLength - indent; |
| 49 | - int len = 0; | |
| 50 | - int doIndent = 0; | |
| 49 | + int len = 0, doIndent = 0, lineCnt = 0; | |
| 51 | 50 | const char *zBuf; |
| 52 | - int lineCnt = 0; | |
| 53 | 51 | |
| 54 | 52 | #if defined(_WIN32) |
| 55 | 53 | if( lineLength<0 ){ |
| 56 | 54 | CONSOLE_SCREEN_BUFFER_INFO csbi; |
| 57 | 55 | memset(&csbi, 0, sizeof(CONSOLE_SCREEN_BUFFER_INFO)); |
| @@ -81,13 +79,13 @@ | ||
| 81 | 79 | if( tlen<=0 ){ |
| 82 | 80 | tlen = strlen(zText); |
| 83 | 81 | } |
| 84 | 82 | while( fossil_isspace(zText[0]) ){ zText++; } |
| 85 | 83 | if( zText[0]==0 ){ |
| 86 | - if( doIndent==0 ){ | |
| 84 | + if( !doIndent ){ | |
| 87 | 85 | fossil_print("\n"); |
| 88 | - lineCnt = 1; | |
| 86 | + lineCnt++; | |
| 89 | 87 | } |
| 90 | 88 | return lineCnt; |
| 91 | 89 | } |
| 92 | 90 | zBuf = zText; |
| 93 | 91 | for(;;){ |
| 94 | 92 |
| --- 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 |