Fixing favorites as nil issue

This commit is contained in:
sloumdrone 2019-01-07 08:08:50 -08:00
parent 43a2051319
commit 546cc6ad5c
1 changed files with 2 additions and 2 deletions

4
stubb
View File

@ -5,7 +5,7 @@ local socket = require("socket")
local urlparser = require("socket.url")
local separator = '- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n'
local valid_types = {'0', '1', 'i'}
session = { tabs = { } }
session = { tabs = { }, favorites = {} }
local save_file_location = string.format('%s/.stubbfaves', assert(os.getenv('HOME'), 'Unable to get home directory'))
@ -399,7 +399,7 @@ end
function save_file()
local t = session.tabs[session.current_tab]
if not t.filedata then return print('No file available. Save canceled.') end
if not t.filedata then return print('No file available. Save cancelled.') end
local homedir = assert(os.getenv('HOME'), 'Unable to find home directory')
io.write('Enter the filename to save as (! to cancel): ' .. homedir .. '/')
local filename = io.read()