Change formatting rules
This commit is contained in:
12
libu/path.c
12
libu/path.c
@@ -2,7 +2,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
bool path_validate_char (char ch) {
|
||||
bool path_validate_char(char ch) {
|
||||
return ((ch >= '0' && ch <= '9') ||
|
||||
(ch >= 'a' && ch <= 'z') ||
|
||||
(ch >= 'A' && ch <= 'Z') ||
|
||||
@@ -12,7 +12,7 @@ bool path_validate_char (char ch) {
|
||||
(ch == '.'));
|
||||
}
|
||||
|
||||
bool path_validate (const char* path) {
|
||||
bool path_validate(const char* path) {
|
||||
if (path == NULL || *path == '\0')
|
||||
return false;
|
||||
|
||||
@@ -25,7 +25,7 @@ bool path_validate (const char* path) {
|
||||
if (*ptr == '/' && *(ptr + 1) == '/')
|
||||
return false;
|
||||
|
||||
if (!path_validate_char (*ptr))
|
||||
if (!path_validate_char(*ptr))
|
||||
return false;
|
||||
|
||||
ptr++;
|
||||
@@ -37,7 +37,7 @@ bool path_validate (const char* path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool path_parse (const char* source, char* volume, const char** path) {
|
||||
bool path_parse(const char* source, char* volume, const char** path) {
|
||||
if (source == NULL || volume == NULL || path == NULL)
|
||||
return false;
|
||||
|
||||
@@ -58,14 +58,14 @@ bool path_parse (const char* source, char* volume, const char** path) {
|
||||
|
||||
const char* internal_path = &source[i + 1];
|
||||
|
||||
if (!path_validate (internal_path))
|
||||
if (!path_validate(internal_path))
|
||||
return false;
|
||||
|
||||
*path = internal_path;
|
||||
return true;
|
||||
}
|
||||
|
||||
const char* path_basename (const char* path) {
|
||||
const char* path_basename(const char* path) {
|
||||
if (path == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user