From bdbba595ca8d30ffdae2344ac67a115ed08d5e02 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Tue, 29 Nov 2011 12:12:01 +0100 Subject: [PATCH] bee-dep: exit with error if DEPENDENCIES files is empty! --- src/graph.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/graph.c b/src/graph.c index b6ba0d8..0643d26 100644 --- a/src/graph.c +++ b/src/graph.c @@ -248,6 +248,14 @@ int graph_insert_nodes(struct hash *hash, char *filename) return EXIT_FAILURE; } + if(line_cnt == 0) { + fprintf(stderr, "bee-dep: error: file '%s' is empty\n", filename); + /* WTF: why can't we return 0 here for errors ??? */ + return EXIT_FAILURE; + } + + /* we dont't want to exit on success ??? or do we? i don't get it! */ + /* but works for me now.. 8) */ return EXIT_SUCCESS; }