Simple patch for md5sum to support DOS files
It took me a while to figure out why md5sum -c would
work with some files and not others.
Turns out the failing files have DOS line endings. This
patch makes md5sum work with those files too.
Any chance of applying it? It's real simple. :)
Thanks,
- Scott
--- md5sum.c.orig 2003-10-21 11:11:06.000000000 -0700
+++ md5sum.c 2003-10-21 11:09:13.000000000 -0700
@@ -244,6 +244,9 @@
if (i < 2 || i > 255)
return 0;
p[i-1] = '\0';
+ if(p[i-2] == '\r') {
+ p[i-2] = '\0';
+ }
strcpy(file, p);
return rc;
}
Reply to: