mirror of
				https://github.com/kepler155c/opus
				synced 2025-10-31 07:33:00 +00:00 
			
		
		
		
	binary support fixes
This commit is contained in:
		| @@ -669,6 +669,10 @@ if settings.get("motd.enabled") then | ||||
| end | ||||
|  | ||||
| while not bExit do | ||||
| 	local cx = term.getCursorPos() | ||||
| 	if cx ~= 1 then | ||||
| 		print() | ||||
| 	end | ||||
| 	if config.displayDirectory then | ||||
| 		term.setTextColour(_colors.directoryTextColor) | ||||
| 		term.setBackgroundColor(_colors.directoryBackgroundColor) | ||||
|   | ||||
| @@ -223,12 +223,12 @@ function fs.copy(s, t) | ||||
| 		end | ||||
|  | ||||
| 	else | ||||
| 		local sf = Util.readFile(s) | ||||
| 		local sf = Util.readFile(s, 'rb') | ||||
| 		if not sf then | ||||
| 			error('No such file') | ||||
| 		end | ||||
|  | ||||
| 		Util.writeFile(t, sf) | ||||
| 		Util.writeFile(t, sf, 'wb') | ||||
| 	end | ||||
| end | ||||
|  | ||||
|   | ||||
| @@ -154,6 +154,9 @@ function ramfs.open(node, fn, fl) | ||||
|  | ||||
| 		local ctr = 0 | ||||
| 		return { | ||||
| 			readAll = function() | ||||
| 				return string.char(table.unpack(c)) | ||||
| 			end, | ||||
| 			read = function(n) | ||||
| 				if n and n > 1 and ctr < node.size then | ||||
| 					-- some programs open in rb, when it should have | ||||
|   | ||||
| @@ -32,6 +32,7 @@ function UI.Tabs:add(children) | ||||
| 	if not self.tabBar then | ||||
| 		self.tabBar = UI.TabBar({ | ||||
| 			buttons = buttons, | ||||
| 			backgroundColor = self.barBackgroundColor, | ||||
| 		}) | ||||
| 	else | ||||
| 		self.tabBar:addButtons(buttons) | ||||
|   | ||||
| @@ -493,7 +493,7 @@ function Util.backup(fname) | ||||
| 	fs.copy(fname, backup) | ||||
| end | ||||
|  | ||||
| function Util.writeFile(fname, data) | ||||
| function Util.writeFile(fname, data, flags) | ||||
| 	if not fname or not data then error('Util.writeFile: invalid parameters', 2) end | ||||
|  | ||||
| 	if fs.exists(fname) then | ||||
| @@ -505,7 +505,7 @@ function Util.writeFile(fname, data) | ||||
| 		end | ||||
| 	end | ||||
|  | ||||
| 	local file = io.open(fname, "w") | ||||
| 	local file = io.open(fname, flags or "w") | ||||
| 	if not file then | ||||
| 		error('Unable to open ' .. fname, 2) | ||||
| 	end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 kepler155c@gmail.com
					kepler155c@gmail.com