From 3ebeabebde7cb1758666cab32a73658f516bb199 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 3 Oct 2022 05:51:21 +0000 Subject: patch: make slurp() return void It sysfatals if it fails and has no non-success returns. --- sys/src/cmd/patch.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sys/src/cmd/patch.c') diff --git a/sys/src/cmd/patch.c b/sys/src/cmd/patch.c index 394f4bfc0..7b25285cb 100644 --- a/sys/src/cmd/patch.c +++ b/sys/src/cmd/patch.c @@ -459,7 +459,7 @@ Free: free(changed); } -int +void slurp(Fbuf *f, char *path) { int n, i, fd, sz, len, nlines, linesz; @@ -502,7 +502,6 @@ slurp(Fbuf *f, char *path) f->lines = lines; f->nlines = nlines; f->lastln = -1; - return 0; } char* @@ -569,8 +568,8 @@ apply(Patch *p, char *fname) for(i = 0; i < p->nhunk; i++){ h = &p->hunk[i]; if(curfile == nil || strcmp(curfile, h->newpath) != 0){ - if(!dryrun && slurp(&f, h->oldpath) == -1) - sysfatal("slurp %s: %r", h->oldpath); + if(!dryrun) + slurp(&f, h->oldpath); curfile = h->newpath; e = f.buf; } -- cgit v1.2.3