Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
bd1e74b8
Commit
bd1e74b8
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Add getdircase() - like fexistcase(), but for sub-directory names
parent
b1ce58ad
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!455
Update branch with changes from master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/xpdev/dirwrap.c
+14
-4
14 additions, 4 deletions
src/xpdev/dirwrap.c
src/xpdev/dirwrap.h
+1
-0
1 addition, 0 deletions
src/xpdev/dirwrap.h
with
15 additions
and
4 deletions
src/xpdev/dirwrap.c
+
14
−
4
View file @
bd1e74b8
...
...
@@ -577,9 +577,9 @@ bool fexist(const char *filespec)
}
/****************************************************************************/
/* Fixes upper/lowercase filename for Unix file systems
*/
/* Fixes upper/lowercase filename
or dirname
for Unix file systems */
/****************************************************************************/
bool
fexist
case
(
char
*
path
)
static
bool
getfile
case
(
char
*
path
,
bool
dir
)
{
#if defined(_WIN32)
...
...
@@ -595,7 +595,7 @@ bool fexistcase(char *path)
_findclose
(
handle
);
if
(
f
.
attrib
&
_A_SUBDIR
)
if
(
INT_TO_BOOL
(
f
.
attrib
&
_A_SUBDIR
)
!=
dir
)
return
(
false
);
fname
=
getfname
(
path
);
/* Find filename in path */
...
...
@@ -636,7 +636,7 @@ bool fexistcase(char *path)
}
#endif
if
(
glob
(
globme
,
GLOB_MARK
,
NULL
,
&
glb
)
!=
0
)
if
(
glob
(
globme
,
dir
?
GLOB_ONLYDIR
:
GLOB_MARK
,
NULL
,
&
glb
)
!=
0
)
return
(
false
);
if
(
glb
.
gl_pathc
>
0
)
{
...
...
@@ -657,6 +657,16 @@ bool fexistcase(char *path)
#endif
}
bool
fexistcase
(
char
*
path
)
{
return
getfilecase
(
path
,
false
);
}
bool
getdircase
(
char
*
path
)
{
return
getfilecase
(
path
,
true
);
}
/****************************************************************************/
/* Returns true if the filename specified is a directory */
/****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
src/xpdev/dirwrap.h
+
1
−
0
View file @
bd1e74b8
...
...
@@ -219,6 +219,7 @@ DLLEXPORT char* getfext(const char* path);
DLLEXPORT
int
getfattr
(
const
char
*
filename
);
DLLEXPORT
int
getfmode
(
const
char
*
filename
);
DLLEXPORT
uint
getfilecount
(
const
char
*
path
);
DLLEXPORT
bool
getdircase
(
char
*
path
);
DLLEXPORT
char
*
getdirname
(
const
char
*
path
);
DLLEXPORT
size_t
getdirsize
(
const
char
*
path
,
bool
include_subdirs
,
bool
subdir_only
);
DLLEXPORT
uint64_t
getdisksize
(
const
char
*
path
,
uint64_t
unit
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment