//usage: "\n -f Ignore case"
//usage: "\n -g General numerical sort"
//usage: "\n -i Ignore unprintable characters"
-//usage: "\n -k Sort key"
//usage: "\n -M Sort month"
//usage: )
+//-h, --human-numeric-sort: compare human readable numbers (e.g., 2K 1G)
//usage: "\n -n Sort numbers"
//usage: IF_FEATURE_SORT_BIG(
//usage: "\n -o Output to file"
-//usage: "\n -k Sort by key"
-//usage: "\n -t CHAR Key separator"
+//usage: "\n -t CHAR Field separator"
+//usage: "\n -k N[,M] Sort by Nth field"
//usage: )
//usage: "\n -r Reverse sort order"
//usage: IF_FEATURE_SORT_BIG(
}
}
}
+ /* Remove last delim: "abc:def:" => "abc:def" */
+ if (key_separator && j && end != 0)
+ end--;
}
if (!j) start = end;
}
if (start > len) start = len;
}
/* Make the copy */
- if (end < start) end = start;
+ if (end < start)
+ end = start;
str = xstrndup(str+start, end-start);
/* Handle -d */
if (flags & FLAG_d) {