diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-01-13 16:01:06 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-01-13 16:01:06 +0000 |
commit | 585b049c9a3f424faa33faaf0b9c19a0eec73a15 (patch) | |
tree | 258f874b307dfb5f0a33eadf645316bb6333fe3b | |
parent | f6c3bc23f6f2b21ee21428e638a3af32771072a7 (diff) | |
download | acf-gnats-585b049c9a3f424faa33faaf0b9c19a0eec73a15.tar.bz2 acf-gnats-585b049c9a3f424faa33faaf0b9c19a0eec73a15.tar.xz |
Modified fs.lua to survive nil parameters. Added create_directory and used within create_file and write_file. Reviewed each read_file call to make sure handles nil return value.
git-svn-id: svn://svn.alpinelinux.org/acf/gnats/trunk@1677 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | gnats-model.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gnats-model.lua b/gnats-model.lua index c3d75e4..a3afc02 100644 --- a/gnats-model.lua +++ b/gnats-model.lua @@ -376,7 +376,7 @@ end function getconfig() if (fs.is_file(configfile)) then - return format.parse_ini_file(fs.read_file(configfile), "") or {} + return format.parse_ini_file(fs.read_file(configfile) or "", "") or {} end return {} end @@ -418,7 +418,7 @@ function get_filedetails(self,path) type="longtext", name="filecontent" .. (num or ""), label="File content", - value=fs.read_file(path), + value=fs.read_file(path) or "", }) -- Sum all errors into one cfe |