All pastes #27675 Raw Edit

Mine

public text v1 · immutable
#27675 ·published 2005-11-05 01:48 UTC
rendered paste body
old_merge3 = merge3

function merge3 (anc_path, left_path, right_path, merged_path, ancestor, left, right)
	local tmp = io.open(merged_path, "r")
	if (tmp ~= nil) then
		local pre = tmp:read("*a")
		io.close(tmp)
		return pre
	end
	local ret = old_merge3(anc_path, left_path, right_path, merge_path, ancestor, left, right)
	tmp = io.open(merged_path, "w") 
	if (tmp == nil) then
		return nil
	end
	tmp:write(ret)
	io.close(tmp)
	return ret
end