Blob Blame History Raw
--- file-4.21/src/readelf.c.core_from	2007-08-15 12:11:37.000000000 +0200
+++ file-4.21/src/readelf.c	2007-08-15 12:11:53.000000000 +0200
@@ -569,8 +569,8 @@
 	 * doesn't include the terminating null in the
 	 * name....
 	 */
-	if ((namesz == 4 && strncmp((char *)&nbuf[noff], "CORE", 4) == 0) ||
-	    (namesz == 5 && strcmp((char *)&nbuf[noff], "CORE") == 0)) {
+	if ((namesz == 4 && strncmp((char *)&nbuf[noff], "CORE", 4) == 0 && xnh_type == NT_PRPSINFO) ||
+	    (namesz == 5 && strcmp((char *)&nbuf[noff], "CORE") == 0 && xnh_type == NT_PRPSINFO)) {
 		os_style = OS_STYLE_SVR4;
 	} 
 
@@ -617,6 +617,7 @@
 				return size;
 			return size;
 		}
+	    *flags |= FLAGS_DID_CORE;
 		break;
 
 	default:
@@ -689,11 +690,11 @@
 			tryanother:
 				;
 			}
+	        *flags |= FLAGS_DID_CORE;
 		}
 		break;
 	}
 #endif
-	*flags |= FLAGS_DID_CORE;
 	return offset;
 }