Mercurial > hg
comparison mercurial/mpatch.c @ 29749:155f0cc3f813
mpatch: raise MemoryError instead of mpatchError if lalloc() failed
MemoryError is handled differently in dispatch._runcatch().
Since mpatch_errors[] isn't that useful now, I've changed it to a simple
switch statement.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 07 Aug 2016 10:06:56 +0900 |
parents | 9a1685c70db4 |
children | 347c0f4232e1 |
comparison
equal
deleted
inserted
replaced
29748:5e2365698d44 | 29749:155f0cc3f813 |
---|---|
24 #include <string.h> | 24 #include <string.h> |
25 | 25 |
26 #include "bitmanipulation.h" | 26 #include "bitmanipulation.h" |
27 #include "compat.h" | 27 #include "compat.h" |
28 #include "mpatch.h" | 28 #include "mpatch.h" |
29 | |
30 char *mpatch_errors[] = {NULL, "invalid patch", "patch cannot be decoded", | |
31 "no memory"}; | |
32 | 29 |
33 static struct mpatch_flist *lalloc(ssize_t size) | 30 static struct mpatch_flist *lalloc(ssize_t size) |
34 { | 31 { |
35 struct mpatch_flist *a = NULL; | 32 struct mpatch_flist *a = NULL; |
36 | 33 |