From 829d65b40ae0c5ab2e60ce35ee32087b4a7b1e84 Mon Sep 17 00:00:00 2001 From: Raymond Pasco Date: Thu, 1 Oct 2015 13:23:29 -0400 Subject: [PATCH] Check if directory already exists when using -c --- vere/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vere/main.c b/vere/main.c index da684a737e..e5e08da8bb 100644 --- a/vere/main.c +++ b/vere/main.c @@ -322,6 +322,14 @@ main(c3_i argc, return 1; } + if ( c3y == u3_Host.ops_u.nuu ) { + struct stat s; + if ( !stat(u3_Host.dir_c, &s) ) { + fprintf(stderr, "used -c but %s already exists\n", u3_Host.dir_c); + exit(1); + } + } + u3_ve_sysopt(); printf("~\n");