Created attachment 811 [details] Delay opening output file until input files are processed In the busybox sort command, the output file is opened, truncated and presumably verified before the input files are read and sorted. This causes problems when applications intend to sort a file on top of itself (e.g. ctags). The provided patch delays the opening/truncation of the output file until after the input files are read and sorted. This allows something like: sort -o F F to sort file F putting the output into F. This is consistent with the Linux sort command which for the most part does this as well. This patch has been tested on an earlier version of busybox and appears to work well.
Thanks! Fixed in git, will be in 1.16.x