Skip to content

Commit

Permalink
cleanup code to be more transparent
Browse files Browse the repository at this point in the history
doesn't use static symbol name in prototype or parameter name, it is confusing
  • Loading branch information
jmalak committed Jan 2, 2025
1 parent 3647100 commit 72f5bf4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions cmd/mkdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#include "../include/misc.h"
#include "../include/lfnfuncs.h"

int recursive_mkdir(const char * path, int optRecursiveMode, int optQuiet)
int recursive_mkdir(const char * path, int recursiveMode, int quiet)
{
if (optRecursiveMode) {
if (recursiveMode) {
char fullname[MAXPATH];
char *p = fullname;
int flag_not_done = 0;
Expand All @@ -43,7 +43,7 @@ int recursive_mkdir(const char * path, int optRecursiveMode, int optQuiet)
ret = mkdir(fullname);
}
if (ret) {
if (!optQuiet) {
if (!quiet) {
/* TODO show error message */
}
return ret;
Expand Down
6 changes: 3 additions & 3 deletions cmd/rmdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ int rmdir_withfiles(char * path, int maxlen)
return rmdir(path);
}

int recursive_rmdir(const char * path, int optRecursiveMode, int optQuiet)
int recursive_rmdir(const char * path, int recursiveMode, int quiet)
{
if (optRecursiveMode) {
if (recursiveMode) {
struct dos_ffblk f;
char fullname[MAXPATH + sizeof(f.ff_name) + 2], *p;
int len;
Expand Down Expand Up @@ -133,7 +133,7 @@ int recursive_rmdir(const char * path, int optRecursiveMode, int optQuiet)
*p = 0;

/* prompt user if they are sure, regardless if files or not */
if (!optQuiet) {
if (!quiet) {
int r;
r = userprompt(PROMPT_DELETE_ALL, fullname); /* Are you sure? TODO fix me */

Expand Down
2 changes: 1 addition & 1 deletion include/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ char *cwd(int drive);
char *abspath(const char * const fnam, const int warn);
char *truepath(const char * const fnam);
int changeDrive(int drive);
int mk_rd_dir(char *param, int (*func) (const char *, int optRecursiveMode, int optQuiet), char *fctname);
int mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname);
void cutBackslash(char * const s);
int cd_dir(char *param, int cdd, const char * const fctname);
enum OnOff onoffStr(char *line);
Expand Down
2 changes: 1 addition & 1 deletion lib/mk_rddir.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ optScanFct(opt_md_rd)
#define SCANNER_FCT 0
#endif

int mk_rd_dir(char *param, int (*func) (const char *, int optRecursiveMode, int optQuiet), char *fctname)
int mk_rd_dir(char *param, int (*func) (const char *, int recursiveMode, int quiet), char *fctname)
{ char **argv;
int argc, opts;
int rv;
Expand Down

0 comments on commit 72f5bf4

Please sign in to comment.