wok-stable rev 12211

syslinux/md5sum.c32: show unchecked files
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 31 15:32:23 2012 +0200 (2012-03-31)
parents d423bfd548e3
children 880772e418b7
files syslinux/stuff/extra/md5sum.c
line diff
     1.1 --- a/syslinux/stuff/extra/md5sum.c	Sat Mar 31 14:27:35 2012 +0200
     1.2 +++ b/syslinux/stuff/extra/md5sum.c	Sat Mar 31 15:32:23 2012 +0200
     1.3 @@ -299,16 +299,6 @@
     1.4  	return hash_value;
     1.5  }
     1.6  
     1.7 -static int valid_name(char *name)
     1.8 -{
     1.9 -	int dots, suffix;
    1.10 -	for (dots = 0, suffix = 0; *name; name++) {
    1.11 -		if (dots) suffix++;
    1.12 -		if (*name == '.') dots++;
    1.13 -	}
    1.14 -	return dots < 2 && suffix <= 3;
    1.15 -}
    1.16 -
    1.17  int main(int argc, char **argv)
    1.18  {
    1.19  	int return_value = EXIT_SUCCESS;
    1.20 @@ -344,11 +334,11 @@
    1.21  			*filename_ptr = '\0';
    1.22  			*++filename_ptr = '/';
    1.23  
    1.24 -			status = "SKIPPED" BLANK;
    1.25 -			if (valid_name(filename_ptr)) {
    1.26 -				hash_value = hash_file(filename_ptr);
    1.27 +			status = "NOT CHECKED" BLANK "\n";
    1.28 +			hash_value = hash_file(filename_ptr);
    1.29 +			if (hash_value) {
    1.30  				status = "OK" BLANK;
    1.31 -				if (hash_value == NULL || strcmp((char*)hash_value, line)) {
    1.32 +				if (strcmp((char*)hash_value, line)) {
    1.33  					return_value = EXIT_FAILURE;
    1.34  					status = "FAILED" BLANK "\n";
    1.35  				}