- // the program will accept the data on stdin: so give it to it!
- if ( !hasFilename && !str.IsEmpty() ) {
+ // the program will accept the data on stdin so normally we should append
+ // "< %s" to the end of the command in such case, but not all commands
+ // behave like this, in particular a common test is 'test -n "$DISPLAY"'
+ // and appending "< %s" to this command makes the test fail... I don't
+ // know of the correct solution, try to guess what we have to do.
+ if ( !hasFilename && !str.IsEmpty()
+#ifdef __UNIX__
+ && !str.StartsWith(_T("test "))
+#endif // Unix
+ ) {