Commit 2ab55776 authored by Robert Griesemer's avatar Robert Griesemer

- fixed untab.go to compile again

R=r
OCL=22871
CL=22871
parent e28692f0
...@@ -19,16 +19,16 @@ var ( ...@@ -19,16 +19,16 @@ var (
) )
func Error(format string, params ...) { func error(format string, params ...) {
fmt.printf(format, params); fmt.Printf(format, params);
sys.exit(1); sys.exit(1);
} }
func Untab(name string, src *os.FD, dst *tabwriter.Writer) { func untab(name string, src *os.FD, dst *tabwriter.Writer) {
n, err := io.Copy(src, dst); n, err := io.Copy(src, dst);
if err != nil { if err != nil {
Error("error while processing %s (%v)", name, err); error("error while processing %s (%v)", name, err);
} }
//dst.Flush(); //dst.Flush();
} }
...@@ -46,13 +46,13 @@ func main() { ...@@ -46,13 +46,13 @@ func main() {
name := flag.Arg(i); name := flag.Arg(i);
src, err := os.Open(name, os.O_RDONLY, 0); src, err := os.Open(name, os.O_RDONLY, 0);
if err != nil { if err != nil {
Error("could not open %s (%v)\n", name, err); error("could not open %s (%v)\n", name, err);
} }
Untab(name, src, dst); untab(name, src, dst);
src.Close(); // ignore errors src.Close(); // ignore errors
} }
} else { } else {
// no files => use stdin // no files => use stdin
Untab("/dev/stdin", os.Stdin, dst); untab("/dev/stdin", os.Stdin, dst);
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment