diff options
| author | Shulhan <ms@kilabit.info> | 2021-04-12 04:00:03 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2021-04-12 12:00:01 +0700 |
| commit | 9cdfa9cd293105ad41345d5dd2af71e7dd10d656 (patch) | |
| tree | 61021b78074d2662a048e3db292776235f8d6947 /script.go | |
| parent | ebbc6775c9c5698b18d1f2e08450641945ce26ff (diff) | |
| download | awwan-9cdfa9cd293105ad41345d5dd2af71e7dd10d656.tar.xz | |
all: check and return an error if start index is out of range
Diffstat (limited to 'script.go')
| -rw-r--r-- | script.go | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -68,6 +68,8 @@ func parseScript(env *environment, content []byte) (s *script, err error) { } stmts := bytes.Split(buf.Bytes(), []byte{'\n'}) + // Add empty line at the beginning to make the start index start from + // 1, not 0. stmts = append([][]byte{{}}, stmts...) s = &script{ |
