pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:611:   //! @expr{a>b@}   //! @endint   //! @note   //! In Pike 7.6 and older this function returned @expr{0@} both when   //! @expr{a<b@} and @expr{a==b@}.   //! @seealso   //! @[sort_array]   int(-1..1) oid_sort_func(string a, string b)   {    int a1, b1; -  sscanf(a, "%d.%s", a1, a); -  sscanf(b, "%d.%s", b1, b); +  sscanf(a, "%d.%[0-9.]", a1, string a_rest); +  sscanf(b, "%d.%[0-9.]", b1, string b_rest);    if (a1>b1) return 1;    if (a1<b1) return -1; -  if (a==b) return 0; -  return oid_sort_func(a,b); +  if (!a_rest || a_rest == "") a_rest = "0"; +  if (!b_rest || b_rest == "") b_rest = "0"; +  if (a_rest == b_rest) return 0; +  return oid_sort_func(a_rest, b_rest);   }      protected array(array(array)) low_greedy_diff(array(array) d1, array(array) d2)   {    array r1, r2, x, y, yb, b, c;    r1 = r2 = ({});    int at, last, seen;    while(-1 != (at = search(d1, ({}), last)))    {    last = at + 1;