From 9fcd9cede183bc43d9419d5cdb3b7801e5a726ab Mon Sep 17 00:00:00 2001 From: tenox Date: Wed, 9 Nov 2016 01:48:10 -0800 Subject: formatting fix --- README.md | 3 ++- fileio.c | 64 +++++++++++++++++++++++++++++++-------------------------------- wfm.c | 6 +----- wfm.h | 2 +- 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index dfd8a43..c47688c 100644 --- a/README.md +++ b/README.md @@ -102,4 +102,5 @@ WFM implemented by [Antoni Sawicki](http://www.tenox.net/) Server Side RFC 1321 implementation by [L. Peter Deutsch](https://sourceforge.net/projects/libmd5-rfc/files/) Client Side RFC 1321 implementation by [Paul Johnston](http://pajhome.org.uk/crypt/md5/index.html) Icons by [Yusuke Kamiyamane](http://p.yusukekamiyamane.com/) -Web browser testing by [BrowserStack](http://www.browserstack.com/) \ No newline at end of file +URL Encoding routines by Fred Bulback +Web browser testing by [BrowserStack](http://www.browserstack.com/) diff --git a/fileio.c b/fileio.c index c2efecd..b5718d3 100644 --- a/fileio.c +++ b/fileio.c @@ -135,8 +135,8 @@ void edit_save(void) { FILE *tempf; char backup[4]={0}; char backup_filename[PHYS_DESTINATION_SIZE]={0}; - regex_t re; - regmatch_t pmatch; + regex_t re; + regmatch_t pmatch; struct stat tmpstat; checkfilename(NULL); @@ -375,21 +375,21 @@ off_t du(char *pdir) { // Called by for move_ui() // void re_dir_ui(char *vdir, int level) { - struct dirent **direntry; - struct stat fileinfo; - char child[VIRT_DIRNAME_SIZE]={0}; - char phy_child[PHYS_DIRNAME_SIZE]={0}; - char re_phys_dirname[PHYS_DIRNAME_SIZE]={0}; - int n; - int nentr, e; - - snprintf(re_phys_dirname, PHYS_DIRNAME_SIZE, "%s/%s", HOMEDIR, vdir); - - if(strlen(re_phys_dirname)<2 || strlen(re_phys_dirname)>(PHYS_DIRNAME_SIZE-2)) - error("Invalid directory name."); - - if(regexec(&dotdot, re_phys_dirname, 0, 0, 0)==0) error("Invalid directory name."); - if(strlen(re_phys_dirname) < strlen(HOMEDIR)) error("Invalid directory name."); + struct dirent **direntry; + struct stat fileinfo; + char child[VIRT_DIRNAME_SIZE]={0}; + char phy_child[PHYS_DIRNAME_SIZE]={0}; + char re_phys_dirname[PHYS_DIRNAME_SIZE]={0}; + int n; + int nentr, e; + + snprintf(re_phys_dirname, PHYS_DIRNAME_SIZE, "%s/%s", HOMEDIR, vdir); + + if(strlen(re_phys_dirname)<2 || strlen(re_phys_dirname)>(PHYS_DIRNAME_SIZE-2)) + error("Invalid directory name."); + + if(regexec(&dotdot, re_phys_dirname, 0, 0, 0)==0) error("Invalid directory name."); + if(strlen(re_phys_dirname) < strlen(HOMEDIR)) error("Invalid directory name."); nentr=scandir(re_phys_dirname, &direntry, 0, alphasort); @@ -398,7 +398,7 @@ void re_dir_ui(char *vdir, int level) { if((direntry[e]->d_name[0]!='.') && (lstat(phy_child, &fileinfo)==0) && S_ISDIR(fileinfo.st_mode)) { - snprintf(child, VIRT_DIRNAME_SIZE, "%s/%s", vdir, direntry[e]->d_name); + snprintf(child, VIRT_DIRNAME_SIZE, "%s/%s", vdir, direntry[e]->d_name); fprintf(cgiOut, "