help/version patches
Robert Collins
robert.collins@itdomain.com.au
Tue Feb 26 04:38:00 GMT 2002
> -----Original Message-----
> From: Joshua Daniel Franklin [mailto:joshuadfranklin@yahoo.com]
It's not - strace is manually entered version info.
> Anyway here is a patch for cygcheck that I think does the
> right thing. Somebody want to take a look?
+const char *revision="$Revision: 1.22 $";
This is suspect: The revision string can look like $Revision:$ in some circumstances - see man co again - which is why I had "$Revision: $ " - note the space after the second $ sign.
Likewise, the
+ /* Get version number out of the autogenerated revision string */
+ (void *) version = malloc(sizeof(revision));
+ strcpy(version, revision+11);
+ version[strlen(version)-1]= 0;
Could be more robustly done as
+ version = (char *) malloc(sizeof(revision));
+ strcpy(version, revision+11);
+ {
+ char *temp=version + strlen (version);
+ while (isspace(--temp) && temp >= version);
+ temp[1]='\0';
+ }
Which will munch an arbitrary amount of whitespace.
Rob
More information about the Cygwin-patches
mailing list