Hi,
I think there is a bug in GNU tsort (at least that supplied in RedHat
GNU/Linux 6.1 and 6.2).
When it detects a cycle in the data it says in the info page:
'   `tsort' will detect cycles in the input and writes the first cycle
encountered to standard error.'

The BSD version in RedHat GNU/Linux 6.0 says this:
'     If the graph contains a cycle (and therefore cannot be properly
sorted),
     one of the arcs in the cycle is ignored and the sort continues.
Cycles
     are reported on standard error.'

This is also the behaviour on solaris, HPUX and AIX.
The effect of this is that given the input
a b
b a

the GNU tsort reports the cycle to stderr and the is no output on stdout

but BSD tsort reports the cycle to stderr and ignores one of the arcs so
on stdout we get:
b
a

While it is arguable that the BSD behaviour is incorrect and that the
data cannot be sorted properly,
it is equally arguable that GNU tsort should behave the same as all the
other UNIXen or at least
have an option to behave like the BSD version.

any chance this can be done?
Cheers,
Jo

--
Cd wrttn wtht vwls s mch trsr



Reply via email to