From: SourceForge.net <no...@so...> - 2004-01-16 13:27:56
|
Bugs item #462423, was opened at 2001-09-18 04:09 Message generated for change (Settings changed) made by fgiust You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=462423&group_id=13153 Category: Tidy functionality Group: None Status: Open Resolution: None >Priority: 9 Submitted By: Nobody/Anonymous (nobody) >Assigned to: fabrizio giustina (fgiust) Summary: stdin support doesn't work on cmd line Initial Comment: For example, whenever I try to process stdin I get this: cat x.html | jtidy -asxml Tidy: can't open file "stdin" I don't think the processing of stdin in Tidy.java's main() is correct. Around line 1562 we have this: if (argc > 1) { file = argv[argIndex]; } else { file = "stdin"; } whereas I think we want this ? if (argc > 1) { file = argv[argIndex]; } else { file = null; } Because: private Node parse(InputStream in, String file, OutputStream out) has this: if (file != null) { in = new FileInputStream(file); inputStreamName = file; } else if (in == null) { in = System.in; inputStreamName = "stdin"; } so passing null as 1st argument to parse() will cause it to use stdin. passing "stdin" will cause it to try and open a fie of that name. Anyway - I have tried patching it like this and I can now get my example command to work. Dave ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2001-09-18 04:25 Message: Logged In: NO Sorry - hadn't meant to be quite so anonymous. Haven't used this system before. Also, should maybe note that the problem occured with the 04aug200-r7dev release. Cheers, da...@wa... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=113153&aid=462423&group_id=13153 |