summaryrefslogtreecommitdiff
path: root/caddyconfig/caddyfile
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-11-04 13:25:37 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2019-11-04 13:25:37 -0700
commit263ffbfaecc5ed8b7f5071baecf51b4e9d90e7bf (patch)
treed1edbf94af113046f5b1331a555ac0adcb5b6381 /caddyconfig/caddyfile
parentbf363f061d03f33a8301466c9c0e2a89d75542c0 (diff)
caddyfile: Fix bug with Delete
It now will delete the current token even if it is the last one
Diffstat (limited to 'caddyconfig/caddyfile')
-rwxr-xr-xcaddyconfig/caddyfile/dispenser.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/caddyconfig/caddyfile/dispenser.go b/caddyconfig/caddyfile/dispenser.go
index de67ee1..6afbd77 100755
--- a/caddyconfig/caddyfile/dispenser.go
+++ b/caddyconfig/caddyfile/dispenser.go
@@ -339,7 +339,7 @@ func (d *Dispenser) Errf(format string, args ...interface{}) error {
// array will become apparent (or worse, hide from you like they
// did me for 3 and a half freaking hours late one night).
func (d *Dispenser) Delete() []Token {
- if d.cursor >= 0 && d.cursor < len(d.tokens)-1 {
+ if d.cursor >= 0 && d.cursor <= len(d.tokens)-1 {
d.tokens = append(d.tokens[:d.cursor], d.tokens[d.cursor+1:]...)
d.cursor--
}