FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't check for \\ No newline at end of file\n if it can't exist by implausible · Pull Request #908 · nodegit/nodegit · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cc  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 11 additions & 7 deletions generate/templates/manual/src/convenient_patch.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,17 @@ PatchData *createFromRaw(git_patch *raw) {
const git_diff_line *line;
git_patch_get_line_in_hunk(&line, raw, i, j);

if (
j == 0 &&
!strcmp(
&line->content[strlen(line->content) - 29],
"\n\\ No newline at end of file\n"
)) {
EOFFlag = true;
if (j == 0) {
// calculate strlen only once for the first line of the first hunk.
int calculatedContentLength = strlen(line->content);
if (
calculatedContentLength > 29 &&
!strcmp(
&line->content[calculatedContentLength - 29],
"\n\\ No newline at end of file\n"
)) {
EOFFlag = true;
}
}

storeLine->origin = line->origin;
Expand Down

Back | FazBrowse Home | New Git URL