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
b74d4478
Commit
b74d4478
authored
Jul 15, 2013
by
crazymaster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the initial line
parent
19bee769
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
23 deletions
+18
-23
src/buf_text.c
+18
-23
No files found.
src/buf_text.c
View file @
b74d4478
...
...
@@ -261,34 +261,29 @@ bool git_buf_text_gather_stats(
/* Counting loop */
while
(
scan
<
end
)
{
unsigned
char
c
=
*
scan
++
;
if
(
c
==
'\r'
)
{
stats
->
cr
++
;
if
(
scan
<
end
&&
*
scan
==
'\n'
)
stats
->
crlf
++
;
c
ontinue
;
}
if
(
c
==
'\n'
)
{
stats
->
lf
++
;
c
ontinue
;
}
if
(
c
==
127
)
/* DEL */
stats
->
nonprintable
++
;
else
if
(
c
<
32
)
{
switch
(
c
)
{
/* BS, HT, ESC and FF */
case
'\
b'
:
case
'\t'
:
case
'\033'
:
case
'\014'
:
if
(
c
>
0x1F
&&
c
!=
0x7F
)
stats
->
printable
++
;
else
switch
(
c
)
{
c
ase
'\0'
:
stats
->
nul
++
;
stats
->
nonprintable
++
;
break
;
c
ase
'\n'
:
stats
->
lf
++
;
break
;
case
'\r'
:
stats
->
cr
++
;
if
(
scan
<
end
&&
*
scan
==
'\n'
)
stats
->
crlf
++
;
break
;
case
'\
t'
:
case
'\f'
:
case
'\v'
:
case
'\b'
:
case
0x1b
:
/*ESC*/
stats
->
printable
++
;
break
;
case
0
:
stats
->
nul
++
;
/* fall through */
default:
stats
->
nonprintable
++
;
break
;
}
}
else
stats
->
printable
++
;
}
return
(
stats
->
nul
>
0
||
...
...
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