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(
...
@@ -261,34 +261,29 @@ bool git_buf_text_gather_stats(
/* Counting loop */
/* Counting loop */
while
(
scan
<
end
)
{
while
(
scan
<
end
)
{
unsigned
char
c
=
*
scan
++
;
unsigned
char
c
=
*
scan
++
;
if
(
c
==
'\r'
)
{
stats
->
cr
++
;
if
(
c
>
0x1F
&&
c
!=
0x7F
)
if
(
scan
<
end
&&
*
scan
==
'\n'
)
stats
->
printable
++
;
stats
->
crlf
++
;
else
switch
(
c
)
{
c
ontinue
;
c
ase
'\0'
:
}
stats
->
nul
++
;
if
(
c
==
'\n'
)
{
stats
->
nonprintable
++
;
stats
->
lf
++
;
break
;
c
ontinue
;
c
ase
'\n'
:
}
stats
->
lf
++
;
if
(
c
==
127
)
break
;
/* DEL */
case
'\r'
:
stats
->
nonprintable
++
;
stats
->
cr
++
;
else
if
(
c
<
32
)
{
if
(
scan
<
end
&&
*
scan
==
'\n'
)
switch
(
c
)
{
stats
->
crlf
++
;
/* BS, HT, ESC and FF */
break
;
case
'\
b'
:
case
'\t'
:
case
'\033'
:
case
'\014'
:
case
'\
t'
:
case
'\f'
:
case
'\v'
:
case
'\b'
:
case
0x1b
:
/*ESC*/
stats
->
printable
++
;
stats
->
printable
++
;
break
;
break
;
case
0
:
stats
->
nul
++
;
/* fall through */
default:
default:
stats
->
nonprintable
++
;
stats
->
nonprintable
++
;
break
;
}
}
}
else
stats
->
printable
++
;
}
}
return
(
stats
->
nul
>
0
||
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