Changeset 3551 for trunk/src


Ignore:
Timestamp:
Jan 29, 2022, 3:57:33 AM (3 years ago)
Author:
bird
Message:

lib/version_compare.c: Corrected sorting of 'vcc/v14.2/' and 'vcc/v14.2.11.9/' so that the former is sorted before the latter, as one would expect when soring a $(wildcard ) listing.

Location:
trunk/src/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/Makefile.kmk

    r3546 r3551  
    100100tstkFsCache_NOINST = 1
    101101
     102PROGRAMS += tstVersionCompare
     103tstVersionCompare_TEMPLATE = BIN
     104tstVersionCompare_SOURCES = version_compare.c
     105tstVersionCompare_DEFS = TEST
     106tstVersionCompare_NOINST = 1
     107
    102108include $(FILE_KBUILD_SUB_FOOTER)
    103109
  • trunk/src/lib/version_compare.c

    r3394 r3551  
    116116    if (ch2 == '~')
    117117        return 1;
    118     if (ch1 == '\0')
     118    if (ch1 == '\0' || ch1 == '/') /* treat '/' similar to '\0' to deal with the v14.2/ vs v14.2.11.9/ case.  */
    119119        return -1;
    120     if (ch2 == '\0')
     120    if (ch2 == '\0' || ch2 == '/')
    121121        return 1;
    122122    if (isdigit(ch1))
     
    251251        { +1, "1.2.3r4567890", "1.2.3rc1" },
    252252        { +1, "1.2.3r4567890", "1.2.3RC1" },
     253        { -1, "/tools/win.amd64/vcc/v14.2/Tools", "/tools/win.amd64/vcc/v14.2.11.9/Tools" },
     254        { -1, "/tools/win.amd64/vcc/v14.2/Tools", "/tools/win.amd64/vcc/v14.211.9/Tools" },
     255        { -1, "/tools/win.amd64/vcc/v14.2/Tools", "/tools/win.amd64/vcc/v14.2r2/Tools" },
     256        { -1, "/tools/win.amd64/vcc/v14.2/Tools", "/tools/win.amd64/vcc/v14.2-r2/Tools" },
    253257    };
    254258    unsigned cErrors = 0;
Note: See TracChangeset for help on using the changeset viewer.