Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
git.9058
0007-verify_path-drop-clever-fallthrough.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0007-verify_path-drop-clever-fallthrough.patch of Package git.9058
From e19e5e66d691bdeeeb5e0ed2ffcecdd7666b0d7b Mon Sep 17 00:00:00 2001 From: Jeff King <peff@peff.net> Date: Sun, 13 May 2018 13:00:23 -0400 Subject: [PATCH 07/11] verify_path: drop clever fallthrough We check ".git" and ".." in the same switch statement, and fall through the cases to share the end-of-component check. While this saves us a line or two, it makes modifying the function much harder. Let's just write it out. Signed-off-by: Jeff King <peff@peff.net> --- read-cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/read-cache.c +++ b/read-cache.c @@ -810,8 +810,7 @@ static int verify_dotfile(const char *re switch (*rest) { /* - * ".git" followed by NUL or slash is bad. This - * shares the path end test with the ".." case. + * ".git" followed by NUL or slash is bad. */ case 'g': case 'G': @@ -819,8 +818,9 @@ static int verify_dotfile(const char *re break; if (rest[2] != 't' && rest[2] != 'T') break; - rest += 2; - /* fallthrough */ + if (rest[3] == '\0' || is_dir_sep(rest[3])) + return 0; + break; case '.': if (rest[1] == '\0' || is_dir_sep(rest[1])) return 0;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor