diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-17 10:28:34 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-08-17 10:28:34 (GMT) |
commit | e11b682e0dc8fca3d036d7d5cb5a8c3ae336e5ec (patch) | |
tree | e26b3b0e5c6700b1f4ff4504aad2b697d216a3a7 | |
parent | 497629b55b3c15f1a7464c8d15db8aca0bb3cd7d (diff) | |
parent | 05edd84341db5937d08bfde47f4497400e26a048 (diff) | |
download | tk-e11b682e0dc8fca3d036d7d5cb5a8c3ae336e5ec.zip tk-e11b682e0dc8fca3d036d7d5cb5a8c3ae336e5ec.tar.gz tk-e11b682e0dc8fca3d036d7d5cb5a8c3ae336e5ec.tar.bz2 |
nmakehlp: Add "-V<num>" option, in order to be able to detect partial version numbers
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/nmakehlp.c | 10 |
2 files changed, 11 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2012-08-17 Jan Nijtmans <nijtmans@users.sf.net> + + * win/nmakehlp.c: Add "-V<num>" option, in order to be able + to detect partial version numbers. + 2012-08-15 Jan Nijtmans <nijtmans@users.sf.net> * win/buildall.vc.bat: Only build the threaded builds by default diff --git a/win/nmakehlp.c b/win/nmakehlp.c index 2868857..d0edcf0 100644 --- a/win/nmakehlp.c +++ b/win/nmakehlp.c @@ -47,7 +47,7 @@ static int CheckForLinkerFeature(const char *option); static int IsIn(const char *string, const char *substring); static int SubstituteFile(const char *substs, const char *filename); static int QualifyPath(const char *path); -static const char *GetVersionFromFile(const char *filename, const char *match); +static const char *GetVersionFromFile(const char *filename, const char *match, int numdots); static DWORD WINAPI ReadFromPipe(LPVOID args); /* globals */ @@ -153,7 +153,7 @@ main( &dwWritten, NULL); return 0; } - printf("%s\n", GetVersionFromFile(argv[2], argv[3])); + printf("%s\n", GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0')); return 0; case 'Q': if (argc != 3) { @@ -479,7 +479,8 @@ IsIn( static const char * GetVersionFromFile( const char *filename, - const char *match) + const char *match, + int numdots) { size_t cbBuffer = 100; static char szBuffer[100]; @@ -509,7 +510,8 @@ GetVersionFromFile( */ q = p; - while (*q && (isalnum(*q) || *q == '.')) { + while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q) + && (!strchr("ab", q[-1])) || --numdots))) { ++q; } |