summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f05d07)
raw | patch | inline | side by side (parent: 1f05d07)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Sat, 20 Nov 2010 00:46:06 +0000 (18:46 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 24 Nov 2010 22:51:42 +0000 (14:51 -0800) |
test-svn-fe segfaults when passed a bogus path. Simplify debugging by
exiting with a meaningful error message instead.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
exiting with a meaningful error message instead.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/svn-fe/svn-fe.c | patch | blob | history | |
test-svn-fe.c | patch | blob | history | |
vcs-svn/svndump.c | patch | blob | history | |
vcs-svn/svndump.h | patch | blob | history |
index a2677b03e0ff8347d13a5d56f4fa2e1aba18824a..35db24f5eae600a973391915ceb61c4635941aec 100644 (file)
--- a/contrib/svn-fe/svn-fe.c
+++ b/contrib/svn-fe/svn-fe.c
int main(int argc, char **argv)
{
- svndump_init(NULL);
+ if (svndump_init(NULL))
+ return 1;
svndump_read((argc > 1) ? argv[1] : NULL);
svndump_deinit();
svndump_reset();
diff --git a/test-svn-fe.c b/test-svn-fe.c
index 77cf78abcfd18532b1b75e5ad5efa21b27f1a28c..b42ba789b176160285844e49cb834d60170d9a54 100644 (file)
--- a/test-svn-fe.c
+++ b/test-svn-fe.c
{
if (argc != 2)
usage("test-svn-fe <file>");
- svndump_init(argv[1]);
+ if (svndump_init(argv[1]))
+ return 1;
svndump_read(NULL);
svndump_deinit();
svndump_reset();
diff --git a/vcs-svn/svndump.c b/vcs-svn/svndump.c
index 6b64c1b8573c00fd09f6387bbda3714d1336356c..db11851225caa677f187c7142e4fb55f745994fa 100644 (file)
--- a/vcs-svn/svndump.c
+++ b/vcs-svn/svndump.c
handle_revision();
}
-void svndump_init(const char *filename)
+int svndump_init(const char *filename)
{
- buffer_init(filename);
+ if (buffer_init(filename))
+ return error("cannot open %s: %s", filename, strerror(errno));
repo_init();
reset_dump_ctx(~0);
reset_rev_ctx(0);
reset_node_ctx(NULL);
init_keys();
+ return 0;
}
void svndump_deinit(void)
diff --git a/vcs-svn/svndump.h b/vcs-svn/svndump.h
index 93c412f14a4ca48b9de18325c09d69f051d97647..df9ceb0e8d473b65fc22ac142d3856dc4f9980e0 100644 (file)
--- a/vcs-svn/svndump.h
+++ b/vcs-svn/svndump.h
#ifndef SVNDUMP_H_
#define SVNDUMP_H_
-void svndump_init(const char *filename);
+int svndump_init(const char *filename);
void svndump_read(const char *url);
void svndump_deinit(void);
void svndump_reset(void);