This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
randomdude999's profile picture

[1.74] CraftOS shutdown when typing "type "

Started by randomdude999, 26 July 2015 - 12:44 PM
randomdude999 #1
Posted 26 July 2015 - 02:44 PM
VERSION:
MC 1.7.10
Forge 10.13.2.1230
CC 1.74

DESCRIPTION:

CraftOS 1.7 shuts down whenever I type the word "type", followed by a space.

EXPECTED RESULTS:

Autocomplete guessing the first file/dir (".", meaning self) in the current directory

REPRODUCTION STEPS:
  1. Open the gui of any of these fine devices.
  2. Type in "type " (with the space but no need for enter)
  3. Watch the shell crash and the OS shut down.

SCREENSHOT:
http://imgur.com/nRmCWyq


POSSIBLE CAUSE:

Error on line 247 in bios.lua?

EDIT:

Manual debugging ftw. The row 247 of bios.lua contains the following:

tCompletions = _fnComplete( sLine )
The only call I see there is _fnComplete, which for some reason is nil for the "type" command only. The weirdest is the fact that the line just above it checks if _fnComplete exists, like this:

if _fnComplete and nPos == string.len(sLine) then
Also note that this is from the built-in "read" function, and _fnComplete is supposed to be the autocomplete function. I also dug in /rom/startup and … oh no…….. there's a…. TYPO!!! QUICK! TELL DAN THAT /ROM/STARTUP:184 IS SUPPOSED TO BE

shell.setCompletionFunction( "rom/programs/type", completeEither )
(or just let everyone use a quicker badass shutdown by reproducing the bug)
Edited on 27 July 2015 - 06:13 AM
cyanisaac #2
Posted 27 July 2015 - 06:17 AM
Can confirm, this affects computers in CCEmuRedux as well.
randomdude999 #3
Posted 27 July 2015 - 08:07 AM
Lemme just post a jar with the fix… (or you can debug it manually). Here. Hehe, this is like a modded mod :D/>/>

I have NO IDEA how to fix CCEmuRedux though. Maybe you can find the CC jar in ccemu's folder?
Edited on 27 July 2015 - 02:23 PM
Cranium #4
Posted 27 July 2015 - 04:24 PM
Please do not redistribute modified ComputerCraft files. You've posted a fix, and we should see that it gets added to the next version.
Creator #5
Posted 27 July 2015 - 05:39 PM
Confirmed too. That is real weird! How can this happen?
randomdude999 #6
Posted 28 July 2015 - 03:01 PM
Please do not redistribute modified ComputerCraft files. You've posted a fix, and we should see that it gets added to the next version.
Oh sorry. I didn't know.
Confirmed too. That is real weird! How can this happen?
It can happen because even programmers make typos.

Also note that the type command can still be used, you just have to be careful. Step by step:
  1. Type "tye", "typ", "ype" or anything of the kind.
  2. Type the path of your file.
  3. Fix your spelling in the beginning.
  4. Press enter.
Edited on 28 July 2015 - 01:50 PM
Lion4ever #7
Posted 04 August 2015 - 07:59 PM
This is a duplicate of my post: type-program-argument-completion-error/

Please search the bugs forum before posting something.
Edited on 04 August 2015 - 06:02 PM