Fossil SCM

Merge updates from trunk.

mistachkin 2014-06-19 01:20 UTC respectformatting merge
Commit 4b675fb0e635f8c433ce58bee32fca26c6bbeca7
2 files changed +17 -3 +17 -3
+17 -3
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116116
}
117117
return lineCnt;
118118
}
119119
120120
/*
121
-** Test the comment printing
122121
**
123122
** COMMAND: test-comment-format
123
+**
124
+** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?WIDTH?
125
+**
126
+** Test comment formatting and printing. Use for testing only.
127
+**
128
+** Options:
129
+** --decode Decode the text using the same method used when
130
+** handling the value of a C-card from a manifest.
124131
*/
125132
void test_comment_format(void){
126133
const char *zPrefix;
127
- const char *zText;
134
+ char *zText;
128135
int indent, width;
136
+ int decode = find_option("decode", 0, 0)!=0;
129137
if( g.argc!=4 && g.argc!=5 ){
130138
usage("PREFIX TEXT ?WIDTH?");
131139
}
132140
zPrefix = g.argv[2];
133
- zText = g.argv[3];
141
+ if( decode ){
142
+ zText = mprintf("%s", g.argv[3]);
143
+ defossilize(zText);
144
+ }else{
145
+ zText = g.argv[3];
146
+ }
134147
indent = strlen(zPrefix);
135148
if( g.argc==5 ){
136149
width = atoi(g.argv[4]);
137150
}else{
138151
width = -1; /* automatic */
@@ -139,6 +152,7 @@
139152
}
140153
if( indent>0 ){
141154
fossil_print("%s", zPrefix);
142155
}
143156
fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
157
+ if( zText!=g.argv[3] ) fossil_free(zText);
144158
}
145159
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116 }
117 return lineCnt;
118 }
119
120 /*
121 ** Test the comment printing
122 **
123 ** COMMAND: test-comment-format
 
 
 
 
 
 
 
 
124 */
125 void test_comment_format(void){
126 const char *zPrefix;
127 const char *zText;
128 int indent, width;
 
129 if( g.argc!=4 && g.argc!=5 ){
130 usage("PREFIX TEXT ?WIDTH?");
131 }
132 zPrefix = g.argv[2];
133 zText = g.argv[3];
 
 
 
 
 
134 indent = strlen(zPrefix);
135 if( g.argc==5 ){
136 width = atoi(g.argv[4]);
137 }else{
138 width = -1; /* automatic */
@@ -139,6 +152,7 @@
139 }
140 if( indent>0 ){
141 fossil_print("%s", zPrefix);
142 }
143 fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
 
144 }
145
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116 }
117 return lineCnt;
118 }
119
120 /*
 
121 **
122 ** COMMAND: test-comment-format
123 **
124 ** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?WIDTH?
125 **
126 ** Test comment formatting and printing. Use for testing only.
127 **
128 ** Options:
129 ** --decode Decode the text using the same method used when
130 ** handling the value of a C-card from a manifest.
131 */
132 void test_comment_format(void){
133 const char *zPrefix;
134 char *zText;
135 int indent, width;
136 int decode = find_option("decode", 0, 0)!=0;
137 if( g.argc!=4 && g.argc!=5 ){
138 usage("PREFIX TEXT ?WIDTH?");
139 }
140 zPrefix = g.argv[2];
141 if( decode ){
142 zText = mprintf("%s", g.argv[3]);
143 defossilize(zText);
144 }else{
145 zText = g.argv[3];
146 }
147 indent = strlen(zPrefix);
148 if( g.argc==5 ){
149 width = atoi(g.argv[4]);
150 }else{
151 width = -1; /* automatic */
@@ -139,6 +152,7 @@
152 }
153 if( indent>0 ){
154 fossil_print("%s", zPrefix);
155 }
156 fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
157 if( zText!=g.argv[3] ) fossil_free(zText);
158 }
159
+17 -3
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116116
}
117117
return lineCnt;
118118
}
119119
120120
/*
121
-** Test the comment printing
122121
**
123122
** COMMAND: test-comment-format
123
+**
124
+** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?WIDTH?
125
+**
126
+** Test comment formatting and printing. Use for testing only.
127
+**
128
+** Options:
129
+** --decode Decode the text using the same method used when
130
+** handling the value of a C-card from a manifest.
124131
*/
125132
void test_comment_format(void){
126133
const char *zPrefix;
127
- const char *zText;
134
+ char *zText;
128135
int indent, width;
136
+ int decode = find_option("decode", 0, 0)!=0;
129137
if( g.argc!=4 && g.argc!=5 ){
130138
usage("PREFIX TEXT ?WIDTH?");
131139
}
132140
zPrefix = g.argv[2];
133
- zText = g.argv[3];
141
+ if( decode ){
142
+ zText = mprintf("%s", g.argv[3]);
143
+ defossilize(zText);
144
+ }else{
145
+ zText = g.argv[3];
146
+ }
134147
indent = strlen(zPrefix);
135148
if( g.argc==5 ){
136149
width = atoi(g.argv[4]);
137150
}else{
138151
width = -1; /* automatic */
@@ -139,6 +152,7 @@
139152
}
140153
if( indent>0 ){
141154
fossil_print("%s", zPrefix);
142155
}
143156
fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
157
+ if( zText!=g.argv[3] ) fossil_free(zText);
144158
}
145159
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116 }
117 return lineCnt;
118 }
119
120 /*
121 ** Test the comment printing
122 **
123 ** COMMAND: test-comment-format
 
 
 
 
 
 
 
 
124 */
125 void test_comment_format(void){
126 const char *zPrefix;
127 const char *zText;
128 int indent, width;
 
129 if( g.argc!=4 && g.argc!=5 ){
130 usage("PREFIX TEXT ?WIDTH?");
131 }
132 zPrefix = g.argv[2];
133 zText = g.argv[3];
 
 
 
 
 
134 indent = strlen(zPrefix);
135 if( g.argc==5 ){
136 width = atoi(g.argv[4]);
137 }else{
138 width = -1; /* automatic */
@@ -139,6 +152,7 @@
139 }
140 if( indent>0 ){
141 fossil_print("%s", zPrefix);
142 }
143 fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
 
144 }
145
--- src/comformat.c
+++ src/comformat.c
@@ -116,23 +116,36 @@
116 }
117 return lineCnt;
118 }
119
120 /*
 
121 **
122 ** COMMAND: test-comment-format
123 **
124 ** Usage: %fossil test-comment-format ?OPTIONS? PREFIX TEXT ?WIDTH?
125 **
126 ** Test comment formatting and printing. Use for testing only.
127 **
128 ** Options:
129 ** --decode Decode the text using the same method used when
130 ** handling the value of a C-card from a manifest.
131 */
132 void test_comment_format(void){
133 const char *zPrefix;
134 char *zText;
135 int indent, width;
136 int decode = find_option("decode", 0, 0)!=0;
137 if( g.argc!=4 && g.argc!=5 ){
138 usage("PREFIX TEXT ?WIDTH?");
139 }
140 zPrefix = g.argv[2];
141 if( decode ){
142 zText = mprintf("%s", g.argv[3]);
143 defossilize(zText);
144 }else{
145 zText = g.argv[3];
146 }
147 indent = strlen(zPrefix);
148 if( g.argc==5 ){
149 width = atoi(g.argv[4]);
150 }else{
151 width = -1; /* automatic */
@@ -139,6 +152,7 @@
152 }
153 if( indent>0 ){
154 fossil_print("%s", zPrefix);
155 }
156 fossil_print("(%d lines output)\n", comment_print(zText, indent, width));
157 if( zText!=g.argv[3] ) fossil_free(zText);
158 }
159

Keyboard Shortcuts

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