Diff

Differences From Artifact [2628bc220f]:

To Artifact [50cddefa11]:


            1  +# strtonum --- convert string to number
            2  +
            3  +#
            4  +# Arnold Robbins, arnold@skeeve.com, Public Domain
            5  +# February, 2004
            6  +
            7  +function mystrtonum(str,        ret, chars, n, i, k, c)
            8  +{
            9  +    if (str ~ /^0[0-7]*$/) {
           10  +        # octal
           11  +        n = length(str)
           12  +        ret = 0
           13  +        for (i = 1; i <= n; i++) {
           14  +            c = substr(str, i, 1)
           15  +            if ((k = index("01234567", c)) > 0)
           16  +                k-- # adjust for 1-basing in awk
           17  +
           18  +            ret = ret * 8 + k
           19  +        }
           20  +    } else if (str ~ /^0[xX][0-9a-fA-f]+/) {
           21  +        # hexadecimal
           22  +        str = substr(str, 3)    # lop off leading 0x
           23  +        n = length(str)
           24  +        ret = 0
           25  +        for (i = 1; i <= n; i++) {
           26  +            c = substr(str, i, 1)
           27  +            c = tolower(c)
           28  +            if ((k = index("0123456789", c)) > 0)
           29  +                k-- # adjust for 1-basing in awk
           30  +            else if ((k = index("abcdef", c)) > 0)
           31  +                k += 9
           32  +
           33  +            ret = ret * 16 + k
           34  +        }
           35  +    } else if (str ~ /^[-+]?([0-9]+([.][0-9]*([Ee][0-9]+)?)?|([.][0-9]+([Ee][-+]?[0-9]+)?))$/) {
           36  +        # decimal number, possibly floating point
           37  +        ret = str + 0
           38  +    } else
           39  +        ret = "NOT-A-NUMBER"
           40  +
           41  +    return ret
           42  +}
           43  +
     1     44   /^End of search list/{
     2     45   	in_searchpath = 0;
     3     46   }
     4     47   
     5     48   (in_searchpath == 1){
     6     49   	searchpath = $0;
     7     50   	sub(/^  */, "", searchpath);
................................................................................
    62    105   }
    63    106   
    64    107   END{
    65    108   	for (key in copy) {
    66    109   		split(key, parts, SUBSEP);
    67    110   
    68    111   		src = parts[1];
    69         -		idx = strtonum(parts[2]);
          112  +		idx = mystrtonum(parts[2]);
    70    113   		dest = copy[key];
    71    114   
    72    115   		destcopy[dest,idx] = src;
    73    116   		destcopyfiles[dest] = 1;
    74    117   	}
    75    118   
    76    119   	for (destfile in destcopyfiles) {