From 180b6ab7c204ddf3a8aa2b9b022085e6a96ff99a Mon Sep 17 00:00:00 2001 From: Suleyman Farajli Date: Tue, 7 Jan 2025 02:24:19 +0400 Subject: program name changed to 'ash' --- src/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.go b/src/main.go index cfcb27c..143b165 100644 --- a/src/main.go +++ b/src/main.go @@ -592,7 +592,7 @@ func main() { argv := os.Args; argc := len(argv); progname = argv[0] - suffix := ".gorth" + suffix := ".ash" if argc != 2 { fmt.Fprintf(os.Stderr, "%s: error: expected one input file.\n", progname) @@ -600,14 +600,14 @@ func main() { } srcFile := argv[argc - 1] - if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 7 { + if !strings.HasSuffix(srcFile, suffix) || len(srcFile) < 5 { fmt.Fprintf(os.Stderr, "%s: error: invalid file format '%s'.\n", progname, srcFile) os.Exit(1) } - assemFile := srcFile[:len(srcFile) - 6] + ".s" - objFile := srcFile[:len(srcFile) - 6] + ".o" - binFile := srcFile[:len(srcFile) - 6] + binFile := srcFile[:len(srcFile) - 4] + assemFile := binFile + ".s" + objFile := binFile + ".o" _, err := os.Stat(srcFile) if err != nil { fmt.Fprintf(os.Stderr, "%s: error: %s.\n", progname, err) -- cgit v1.2.3