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
d7354d70
Commit
d7354d70
authored
Mar 30, 2011
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build_varname: lowercase the variable name
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent
0bbaf9aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/config.c
+7
-3
No files found.
src/config.c
View file @
d7354d70
...
@@ -686,9 +686,10 @@ static int config_parse(git_config *cfg_file)
...
@@ -686,9 +686,10 @@ static int config_parse(git_config *cfg_file)
}
}
/*
/*
* Gives $section.$name back, using only name_len chars from the name,
* Returns $section.$name, using only name_len chars from the name,
* which is useful so we don't have to copy the variable name twice.
* which is useful so we don't have to copy the variable name
* Don't forget to free the memory you get.
* twice. The name of the variable is set to lowercase.
*Don't forget to free the buffer.
*/
*/
static
char
*
build_varname
(
const
char
*
section
,
const
char
*
name
,
int
name_len
)
static
char
*
build_varname
(
const
char
*
section
,
const
char
*
name
,
int
name_len
)
{
{
...
@@ -703,6 +704,9 @@ static char *build_varname(const char *section, const char *name, int name_len)
...
@@ -703,6 +704,9 @@ static char *build_varname(const char *section, const char *name, int name_len)
return
NULL
;
return
NULL
;
ret
=
snprintf
(
varname
,
total_len
,
"%s.%s"
,
section
,
name
);
ret
=
snprintf
(
varname
,
total_len
,
"%s.%s"
,
section
,
name
);
if
(
ret
>=
0
){
strtolower
(
varname
+
section_len
+
1
);
}
return
varname
;
return
varname
;
}
}
...
...
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