Jump to content




[1.33][Minor] directory climbing bug


4 replies to this topic

#1 Watcher7

  • Members
  • 25 posts
  • LocationEquestria, TX

Posted 29 April 2012 - 03:50 AM

Doing the following will "break" your in-game "OS".
cd rom => cd help
Due to the fact that it cannot tell the difference between the program you want to use and the help file of that program, you cannot run any default programs.
I came up with a very small fix in the "shell" file that is applied to the "shell.run" function, though you may prefer some other method.
function shell.run(_sCommand, ...)
	local sPath = shell.resolveProgram(_sCommand)
	if sPath ~= nil then
		if shell.dir() == "rom/help" then
			sPath = string.gsub(sPath, "help", "programs")
		end
		tProgramStack[#tProgramStack + 1] = sPath
		   local result = os.run(tEnv, sPath, ...)
		tProgramStack[#tProgramStack] = nil
		return result
	   else
		print("No such program")
		return false
	end
end
Another solution would be to add extensions to those files and then add this to the top of "help", you may prefer another method.
tArgs = { ... }
tArgs[1] = tArgs[1]..".help"
Also I did not see a topic related to this bug, so if it exists sorry.

#2 Dirkus7

  • Members
  • 148 posts
  • Locationthe Netherlands

Posted 06 May 2012 - 09:14 PM

Got this problem too, nice fix, should be added by Dan

#3 sam_technologeek

  • New Members
  • 19 posts
  • LocationMilky Way!

Posted 07 May 2012 - 04:18 PM

Nice, I can use it in my virus!

#4 Riddla

  • New Members
  • 3 posts

Posted 25 June 2012 - 12:05 PM

A quick fix would be a reboot command, or shutdown command(I.e. Control+S/ Control+R)

#5 inventor2514

  • Members
  • 63 posts

Posted 03 July 2012 - 04:03 PM

You could still run a default program with its file path.
ex. /rom/programs/cd
It is an inconvenience though, so nice fix.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users