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
b3b36a68
Commit
b3b36a68
authored
Apr 10, 2014
by
Jacques Germishuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce git_buf_putcn
Allows for inserting the same character n amount of times
parent
bcc62293
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/buffer.c
+9
-0
src/buffer.h
+1
-0
No files found.
src/buffer.c
View file @
b3b36a68
...
...
@@ -148,6 +148,15 @@ int git_buf_putc(git_buf *buf, char c)
return
0
;
}
int
git_buf_putcn
(
git_buf
*
buf
,
char
c
,
size_t
len
)
{
ENSURE_SIZE
(
buf
,
buf
->
size
+
len
+
1
);
memset
(
buf
->
ptr
+
buf
->
size
,
c
,
len
);
buf
->
size
+=
len
;
buf
->
ptr
[
buf
->
size
]
=
'\0'
;
return
0
;
}
int
git_buf_put
(
git_buf
*
buf
,
const
char
*
data
,
size_t
len
)
{
ENSURE_SIZE
(
buf
,
buf
->
size
+
len
+
1
);
...
...
src/buffer.h
View file @
b3b36a68
...
...
@@ -88,6 +88,7 @@ GIT_INLINE(bool) git_buf_oom(const git_buf *buf)
*/
int
git_buf_sets
(
git_buf
*
buf
,
const
char
*
string
);
int
git_buf_putc
(
git_buf
*
buf
,
char
c
);
int
git_buf_putcn
(
git_buf
*
buf
,
char
c
,
size_t
len
);
int
git_buf_put
(
git_buf
*
buf
,
const
char
*
data
,
size_t
len
);
int
git_buf_puts
(
git_buf
*
buf
,
const
char
*
string
);
int
git_buf_printf
(
git_buf
*
buf
,
const
char
*
format
,
...)
GIT_FORMAT_PRINTF
(
2
,
3
);
...
...
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