12345678910111213141516171819202122232425262728293031323334 |
- Author: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
- Description:
- File does not always correctly report the faulty command for core files
- anymore.
- diff -Naurp file.orig/src/readelf.c file/src/readelf.c
- --- file.orig/src/readelf.c 2010-07-11 00:17:48.717928843 +0200
- +++ file/src/readelf.c 2010-07-13 16:45:37.341674011 +0200
- @@ -738,6 +738,25 @@ core:
- /*
- * Well, that worked.
- */
- +
- + /*
- + * Try next offsets, in case this match is
- + * in the middle of a string.
- + */
- + size_t k;
- + for (k = i + 1 ; k < NOFFSETS ; k++) {
- + if (prpsoffsets(k) >= prpsoffsets(i))
- + continue;
- + size_t no;
- + int adjust = 1;
- + for (no = doff + prpsoffsets(k);
- + no < doff + prpsoffsets(i); no++)
- + adjust = adjust
- + && isprint(nbuf[no]);
- + if (adjust)
- + i = k;
- + }
- +
- cname = (unsigned char *)
- &nbuf[doff + prpsoffsets(i)];
- for (cp = cname; *cp && isprint(*cp); cp++)
|