diff options
author | Suleyman Farajli <suleyman@farajli.net> | 2025-01-07 02:24:19 +0400 |
---|---|---|
committer | Suleyman Farajli <suleyman@farajli.net> | 2025-01-07 02:24:19 +0400 |
commit | 180b6ab7c204ddf3a8aa2b9b022085e6a96ff99a (patch) | |
tree | afb0144af0ba75d516e100d1fc6fa0c309620c0e /src | |
parent | c9090da5bd98c418f71f9110c6c3d82f2f7d37ee (diff) |
program name changed to 'ash'
Diffstat (limited to 'src')
-rw-r--r-- | src/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
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) |