Fossil SCM

Fix for the 'reserved-names' test.

mistachkin 2021-03-18 03:21 trunk
Commit 84e2abea1c0a07fe2f0c063b914b04ad44e27819f87bc4db29c0605a3d7180a9
1 file changed +21
+21
--- src/file.c
+++ src/file.c
@@ -2565,5 +2565,26 @@
25652565
default:{
25662566
return 0;
25672567
}
25682568
}
25692569
}
2570
+
2571
+/*
2572
+** COMMAND: test-is-reserved-name
2573
+**
2574
+** Usage: %fossil test-is-reserved-name FILENAMES...
2575
+**
2576
+** Passes each given name to file_is_reserved_name() and outputs one
2577
+** line per file: the result value of that function followed by the
2578
+** name.
2579
+*/
2580
+void test_is_reserved_name_cmd(void){
2581
+ int i;
2582
+
2583
+ if(g.argc<3){
2584
+ usage("FILENAME_1 [...FILENAME_N]");
2585
+ }
2586
+ for( i = 2; i < g.argc; ++i ){
2587
+ const int check = file_is_reserved_name(g.argv[i], -1);
2588
+ fossil_print("%d %s\n", check, g.argv[i]);
2589
+ }
2590
+}
25702591
--- src/file.c
+++ src/file.c
@@ -2565,5 +2565,26 @@
2565 default:{
2566 return 0;
2567 }
2568 }
2569 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2570
--- src/file.c
+++ src/file.c
@@ -2565,5 +2565,26 @@
2565 default:{
2566 return 0;
2567 }
2568 }
2569 }
2570
2571 /*
2572 ** COMMAND: test-is-reserved-name
2573 **
2574 ** Usage: %fossil test-is-reserved-name FILENAMES...
2575 **
2576 ** Passes each given name to file_is_reserved_name() and outputs one
2577 ** line per file: the result value of that function followed by the
2578 ** name.
2579 */
2580 void test_is_reserved_name_cmd(void){
2581 int i;
2582
2583 if(g.argc<3){
2584 usage("FILENAME_1 [...FILENAME_N]");
2585 }
2586 for( i = 2; i < g.argc; ++i ){
2587 const int check = file_is_reserved_name(g.argv[i], -1);
2588 fossil_print("%d %s\n", check, g.argv[i]);
2589 }
2590 }
2591

Keyboard Shortcuts

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