Cleanup remove_path
Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Alex Riesen committed
Sep 26, 2008 at 08:21 UTC
eb53586ba94087d9750c58d29ff494e5c1a95207
1 file changed
+3
-5
merge-recursive.c
+3
-5
@@ -394,12 +394,10 @@ static int update_stages(const char *path, struct diff_filespec *o,
394
395
static int remove_path(const char *name)
396
{
397
- int ret;
397
char *slash, *dirs;
398
400
- ret = unlink(name);
401
- if (ret)
402
- return ret;
399
+ if (unlink(name))
400
+ return -1;
401
dirs = xstrdup(name);
402
while ((slash = strrchr(name, '/'))) {
403
*slash = '\0';
@@ -407,7 +405,7 @@ static int remove_path(const char *name)
405
break;
406
}
407
free(dirs);
410
- return ret;
408
+ return 0;
409
}
410
411
static int remove_file(struct merge_options *o, int clean,