Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
59403f1f
Commit
59403f1f
authored
Aug 09, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2509 from libgit2/cmn/immediate-multiline
config: a multiline var can start immediately
parents
bb9e6028
9dac1f95
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletions
+14
-1
src/config_file.c
+1
-1
tests/config/stress.c
+13
-0
No files found.
src/config_file.c
View file @
59403f1f
...
...
@@ -1649,7 +1649,7 @@ static int is_multiline_var(const char *str)
}
/* An odd number means last backslash wasn't escaped, so it's multiline */
return
(
end
>
str
)
&&
(
count
&
1
)
;
return
count
&
1
;
}
static
int
parse_multiline_variable
(
struct
reader
*
reader
,
git_buf
*
value
,
int
in_quotes
)
...
...
tests/config/stress.c
View file @
59403f1f
...
...
@@ -90,3 +90,16 @@ void test_config_stress__trailing_backslash(void)
cl_assert_equal_s
(
path
,
str
);
git_config_free
(
config
);
}
void
test_config_stress__complex
(
void
)
{
git_config
*
config
;
const
char
*
str
;
const
char
*
path
=
"./config-immediate-multiline"
;
cl_git_mkfile
(
path
,
"[imm]
\n
multi =
\"\\\n
foo
\"
"
);
cl_git_pass
(
git_config_open_ondisk
(
&
config
,
path
));
cl_git_pass
(
git_config_get_string
(
&
str
,
config
,
"imm.multi"
));
cl_assert_equal_s
(
str
,
"foo"
);
git_config_free
(
config
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment