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
590c5efb
Commit
590c5efb
authored
Nov 07, 2013
by
Sven Strickroth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method
Signed-off-by: Sven Strickroth <email@cs-ware.de>
parent
7dd28dde
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/config_file.c
+3
-3
No files found.
src/config_file.c
View file @
590c5efb
...
...
@@ -1178,7 +1178,7 @@ static int write_section(git_filebuf *file, const char *key)
return
result
;
}
static
int
needsQ
uote
(
const
char
*
value
)
static
int
value_needs_surrounding_q
uote
(
const
char
*
value
)
{
const
char
*
ptr
=
value
;
if
(
*
value
==
' '
)
...
...
@@ -1315,7 +1315,7 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
/* Then replace the variable. If the value is NULL, it
* means we want to delete it, so don't write anything. */
if
(
value
!=
NULL
)
{
if
(
needsQ
uote
(
value
))
if
(
value_needs_surrounding_q
uote
(
value
))
git_filebuf_printf
(
&
file
,
"
\t
%s =
\"
%s
\"\n
"
,
name
,
value
);
else
git_filebuf_printf
(
&
file
,
"
\t
%s = %s
\n
"
,
name
,
value
);
...
...
@@ -1378,7 +1378,7 @@ static int config_write(diskfile_backend *cfg, const char *key, const regex_t *p
if
(
reader
->
buffer
.
size
>
0
&&
*
(
reader
->
buffer
.
ptr
+
reader
->
buffer
.
size
-
1
)
!=
'\n'
)
git_filebuf_write
(
&
file
,
"
\n
"
,
1
);
if
(
needsQ
uote
(
value
))
if
(
value_needs_surrounding_q
uote
(
value
))
git_filebuf_printf
(
&
file
,
"
\t
%s =
\"
%s
\"\n
"
,
name
,
value
);
else
git_filebuf_printf
(
&
file
,
"
\t
%s = %s
\n
"
,
name
,
value
);
...
...
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