Skip to content

Commit

Permalink
Support patches with empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
bp-dev authored and kpdecker committed Mar 5, 2018
1 parent 8616a02 commit e24d789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/patch/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export function applyPatch(source, uniDiff, options = {}) {

for (let j = 0; j < hunk.lines.length; j++) {
let line = hunk.lines[j],
operation = line[0],
content = line.substr(1),
operation = line.length>0 ? line[0] : ' ',
content = line.length>0 ? line.substr(1) : line,
delimiter = hunk.linedelimiters[j];

if (operation === ' ') {
Expand Down

0 comments on commit e24d789

Please sign in to comment.