Fossil SCM

Report an error if the input file to "fossil import" cannot be opened.

drh 2017-06-30 19:00 trunk
Commit 038dcc00e5ead3af8416cb5d16f6535ac9671bf030db963300089b851dc068da
1 file changed +1
--- src/import.c
+++ src/import.c
@@ -1735,10 +1735,11 @@
17351735
if( g.argc!=3 && g.argc!=4 ){
17361736
usage("--git|--svn ?OPTIONS? NEW-REPOSITORY ?INPUT-FILE?");
17371737
}
17381738
if( g.argc==4 ){
17391739
pIn = fossil_fopen(g.argv[3], "rb");
1740
+ if( pIn==0 ) fossil_fatal("cannot open input file \"%s\"", g.argv[3]);
17401741
}else{
17411742
pIn = stdin;
17421743
fossil_binary_mode(pIn);
17431744
}
17441745
if( !incrFlag ){
17451746
--- src/import.c
+++ src/import.c
@@ -1735,10 +1735,11 @@
1735 if( g.argc!=3 && g.argc!=4 ){
1736 usage("--git|--svn ?OPTIONS? NEW-REPOSITORY ?INPUT-FILE?");
1737 }
1738 if( g.argc==4 ){
1739 pIn = fossil_fopen(g.argv[3], "rb");
 
1740 }else{
1741 pIn = stdin;
1742 fossil_binary_mode(pIn);
1743 }
1744 if( !incrFlag ){
1745
--- src/import.c
+++ src/import.c
@@ -1735,10 +1735,11 @@
1735 if( g.argc!=3 && g.argc!=4 ){
1736 usage("--git|--svn ?OPTIONS? NEW-REPOSITORY ?INPUT-FILE?");
1737 }
1738 if( g.argc==4 ){
1739 pIn = fossil_fopen(g.argv[3], "rb");
1740 if( pIn==0 ) fossil_fatal("cannot open input file \"%s\"", g.argv[3]);
1741 }else{
1742 pIn = stdin;
1743 fossil_binary_mode(pIn);
1744 }
1745 if( !incrFlag ){
1746

Keyboard Shortcuts

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