[PATCH] missing break in switch

Dirk Hohndel dirk at hohndel.org
Mon Mar 23 05:35:49 PDT 2015


On Mon, Mar 23, 2015 at 12:29:48AM -0300, Marcos Cardinot wrote:
> From b4cd8716513a6448a84f144b76c33095b1aa0513 Mon Sep 17 00:00:00 2001
> From: Marcos CARDINOT <mcardinot at gmail.com>
> Date: Sun, 22 Mar 2015 22:53:16 -0300
> Subject: [PATCH] load-git::walk_tree_file - missing break in switch
> 
> Simple control flow issue.

I'll slightly change the commit message, see below

> diff --git a/load-git.c b/load-git.c
> index be25e8e..d8052a5 100644
> --- a/load-git.c
> +++ b/load-git.c
> @@ -1460,6 +1460,7 @@ static int walk_tree_file(const char *root, const git_tree_entry *entry, git_rep
>  	case 'S':
>  		if (!strncmp(name, "Site", 4))
>  			return parse_site_entry(repo, entry, name + 5);
> +		break;

You are correct, that's the better coding practice.
Admittedly, the code works as is, but it could easily go wrong if
something odd were added further down the switch statement.

/D



More information about the subsurface mailing list