~delthas/senpai-dev

[Crash]: Pasting may cause a panic

Matt Jolly <kangie@gentoo.org>
Details
Message ID
<d8ea4479-f5a4-455a-8ced-a25920f586a4@gentoo.org>
DKIM signature
missing
Download raw message
Attempting to paste the following:

```


-// This shim header is required for the build to work because the Ink 
Library
-// expects this header to be at a particular location.


```

Reliably results in the following crash:


```

kangie@monolith ~ $ senpai
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
git.sr.ht/~taiite/senpai.parseCommand({0xc0005faf70?, 0x8?})
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/commands.go:879 
+0x159
git.sr.ht/~taiite/senpai.(*App).handleInput(0xc0002b6200, 
{0xc000328bac?, 0x10}, {0xc0005faf70, 0x1})
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/commands.go:943 
+0x177
git.sr.ht/~taiite/senpai.(*App).handleKeyEvent(0xc0002b6200, 
0x5596dffd0e4b?)
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/app.go:681 +0x345
git.sr.ht/~taiite/senpai.(*App).handleUIEvent(0x5596e0377b80?, 
{0x5596e03a2780?, 0xc000e86760?})
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/app.go:473 +0x10e
git.sr.ht/~taiite/senpai.(*App).handleEvent(0xc0000359d8?, 
{{0x5596e0348070?, 0xc000035a08?}, {0x5596e03a2780?, 0xc000e86760?}})
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/app.go:282 +0x3b
git.sr.ht/~taiite/senpai.(*App).eventLoop(0xc0002b6200)
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/app.go:236 +0x5fc
git.sr.ht/~taiite/senpai.(*App).Run(0xc0002b6200)
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/app.go:199 +0x125
main.main()
  
/var/tmp/portage/net-irc/senpai-0.3.0/work/senpai-v0.3.0/cmd/senpai/main.go:149 
+0x7c5
Time: 206h:37m:11s 

```

Suspect this is related to the empty line.
Reply to thread Export thread (mbox)