diff options
Diffstat (limited to 'src/misc.c')
-rw-r--r-- | src/misc.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -16,7 +16,9 @@ static char *GetSymbolName(const char *str); static void ReplaceSymbol(char **str, const char *name, const char *value); /** Determine if a character is a space character. */ -int IsSpace(char ch) { +int +IsSpace(char ch) +{ switch(ch) { case ' ': case '\t': @@ -29,7 +31,9 @@ int IsSpace(char ch) { } /** Determine if a character is a valid for a shell variable. */ -int IsSymbolic(char ch) { +int +IsSymbolic(char ch) +{ if(ch >= 'A' && ch <= 'Z') { return 1; @@ -67,7 +71,9 @@ char *GetSymbolName(const char *str) { } /** Replace "name" with "value" in str (reallocates if needed). */ -void ReplaceSymbol(char **str, const char *name, const char *value) { +void +ReplaceSymbol(char **str, const char *name, const char *value) +{ char *temp; int strLength; @@ -122,7 +128,9 @@ void ReplaceSymbol(char **str, const char *name, const char *value) { } /** Perform shell-like macro path expansion. */ -void ExpandPath(char **path) { +void +ExpandPath(char **path) +{ char *name; char *value; @@ -147,7 +155,9 @@ void ExpandPath(char **path) { } /** Trim leading and trailing whitespace from a string. */ -void Trim(char *str) { +void +Trim(char *str) +{ int length; int start; |