summaryrefslogtreecommitdiff
path: root/command_line/CmdLine/Src/OSLib/Generic.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--command_line/CmdLine/Src/OSLib/Generic.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/command_line/CmdLine/Src/OSLib/Generic.c b/command_line/CmdLine/Src/OSLib/Generic.c
index a4e9fed..f2c2ac9 100644
--- a/command_line/CmdLine/Src/OSLib/Generic.c
+++ b/command_line/CmdLine/Src/OSLib/Generic.c
@@ -48,7 +48,7 @@ int WildCardMatch(char *wild, char *name) {
}
}
- return !name[0] || (name[0] == '/' && !name[1]);
+ return !name[0] || (name[0] == OS_PATHSEP && !name[1]);
}
OSSpec *OS_MatchPath(const char *path) {
@@ -58,7 +58,7 @@ OSSpec *OS_MatchPath(const char *path) {
const char *nptr;
if (path) {
- nptr = strrchr(path, '/');
+ nptr = strrchr(path, OS_PATHSEP);
if (!nptr) {
nptr = path;
strcpyn(wilddir, ".", -1, 256);
@@ -89,7 +89,7 @@ OSSpec *OS_MatchPath(const char *path) {
char *OS_GetFileNamePtr(char *path) {
char *ptr;
- ptr = strrchr(path, '/');
+ ptr = strrchr(path, OS_PATHSEP);
return !ptr ? path : (ptr + 1);
}
@@ -102,12 +102,12 @@ char *OS_GetDirName(const OSPathSpec *spec, char *buf, int size) {
path = OS_PathSpecToString(spec, STSbuf, 256);
pptr = path + strlen(path) - 1;
- if (pptr > path && *pptr == '/') {
+ if (pptr > path && *pptr == OS_PATHSEP) {
*pptr = 0;
--pptr;
}
- while (pptr >= path && *pptr != '/')
+ while (pptr >= path && *pptr != OS_PATHSEP)
pptr--;
strncpy(buf, pptr, size - 1);
@@ -133,8 +133,8 @@ int OS_MakeSpec2(const char *path, const char *filename, OSSpec *spec) {
strncpy(bpath, path, pthlen);
eptr = bpath + pthlen;
- if (eptr[-1] != '/')
- *(eptr++) = '/';
+ if (eptr[-1] != OS_PATHSEP)
+ *(eptr++) = OS_PATHSEP;
strcpy(eptr, filename);
return OS_MakeSpec(bpath, spec, 0);
@@ -323,7 +323,7 @@ char *OS_SpecToStringRelative(const OSSpec *spec, const OSPathSpec *cwdspec, cha
while (cwd > cwdbuf) {
cwd--;
full--;
- if (*cwd == '/')
+ if (*cwd == OS_PATHSEP)
break;
}
@@ -334,7 +334,7 @@ char *OS_SpecToStringRelative(const OSSpec *spec, const OSPathSpec *cwdspec, cha
if (*(++cwd)) {
pptr = path;
while (*cwd) {
- if (*cwd == '/')
+ if (*cwd == OS_PATHSEP)
pptr += sprintf(pptr, "../");
++cwd;
}
@@ -390,7 +390,7 @@ int OS_FindProgram(const char *filename, OSSpec *spec) {
strncpy(temp, filename, 256);
temp[255] = 0;
- if (!strchr(temp, '/')) {
+ if (!strchr(temp, OS_PATHSEP)) {
plist = getenv("PATH");
err = OS_FindFileInPath(temp, plist, spec);
if (!err)