Fossil SCM

In the test-fossil-system command, show the result code coming back from each command.

drh 2021-06-21 12:35 trunk
Commit f6b67e157e53c42bb65dd3ded241922c78062fcd680cfcdf1f2e5ece7cd73402
1 file changed +3 -1
+3 -1
--- src/util.c
+++ src/util.c
@@ -328,19 +328,21 @@
328328
void test_fossil_system_cmd(void){
329329
char zLine[10000];
330330
safeCmdStrTest = 1;
331331
while(1){
332332
size_t n;
333
+ int rc;
333334
printf("system-test> ");
334335
fflush(stdout);
335336
if( !fgets(zLine, sizeof(zLine), stdin) ) break;
336337
n = strlen(zLine);
337338
while( n>0 && fossil_isspace(zLine[n-1]) ) n--;
338339
zLine[n] = 0;
339340
printf("cmd: [%s]\n", zLine);
340341
fflush(stdout);
341
- fossil_system(zLine);
342
+ rc = fossil_system(zLine);
343
+ printf("result: %d\n", rc);
342344
}
343345
}
344346
345347
/*
346348
** Like strcmp() except that it accepts NULL pointers. NULL sorts before
347349
--- src/util.c
+++ src/util.c
@@ -328,19 +328,21 @@
328 void test_fossil_system_cmd(void){
329 char zLine[10000];
330 safeCmdStrTest = 1;
331 while(1){
332 size_t n;
 
333 printf("system-test> ");
334 fflush(stdout);
335 if( !fgets(zLine, sizeof(zLine), stdin) ) break;
336 n = strlen(zLine);
337 while( n>0 && fossil_isspace(zLine[n-1]) ) n--;
338 zLine[n] = 0;
339 printf("cmd: [%s]\n", zLine);
340 fflush(stdout);
341 fossil_system(zLine);
 
342 }
343 }
344
345 /*
346 ** Like strcmp() except that it accepts NULL pointers. NULL sorts before
347
--- src/util.c
+++ src/util.c
@@ -328,19 +328,21 @@
328 void test_fossil_system_cmd(void){
329 char zLine[10000];
330 safeCmdStrTest = 1;
331 while(1){
332 size_t n;
333 int rc;
334 printf("system-test> ");
335 fflush(stdout);
336 if( !fgets(zLine, sizeof(zLine), stdin) ) break;
337 n = strlen(zLine);
338 while( n>0 && fossil_isspace(zLine[n-1]) ) n--;
339 zLine[n] = 0;
340 printf("cmd: [%s]\n", zLine);
341 fflush(stdout);
342 rc = fossil_system(zLine);
343 printf("result: %d\n", rc);
344 }
345 }
346
347 /*
348 ** Like strcmp() except that it accepts NULL pointers. NULL sorts before
349

Keyboard Shortcuts

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