mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(strip_ext): refactor loop.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
cd60a2907a
commit
daaea80895
@ -86,19 +86,20 @@ static char *menu = NULL;
|
||||
static char *
|
||||
strip_ext (char *ss)
|
||||
{
|
||||
char *s = ss;
|
||||
char *s;
|
||||
char *e = NULL;
|
||||
|
||||
while (*s != '\0')
|
||||
for (s = ss; *s != '\0'; s++)
|
||||
{
|
||||
if (*s == '.')
|
||||
e = s;
|
||||
if (IS_PATH_SEP (*s) && e != NULL)
|
||||
e = NULL; /* '.' in *directory* name */
|
||||
s++;
|
||||
}
|
||||
|
||||
if (e != NULL)
|
||||
*e = '\0';
|
||||
|
||||
return ss;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user