mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-01 04:17:02 -05:00
Fixes support of file names starting or ending with a space.
This commit is contained in:
parent
58f191ef1f
commit
35f3c092ed
8 changed files with 65 additions and 23 deletions
18
util.h
18
util.h
|
|
@ -22,26 +22,16 @@
|
|||
/* string */
|
||||
|
||||
/**
|
||||
* Marks the end of the current token, and move to the next one.
|
||||
* Marks the end of the current token, and skip one and only one separator if present.
|
||||
*/
|
||||
static inline char* strtoken(char* s)
|
||||
{
|
||||
while (*s && *s != ' ')
|
||||
++s;
|
||||
if (*s)
|
||||
*s++ = 0;
|
||||
while (*s == ' ')
|
||||
++s;
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move to the next token skipping any separator.
|
||||
*/
|
||||
static inline char* strskip(char* s)
|
||||
{
|
||||
while (*s == ' ')
|
||||
if (*s) {
|
||||
*s = 0;
|
||||
++s;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue