1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 05:48:01 +01:00

Get rid of cropline(), use wtrimspace() instead

There is code duplication with the cropline() function, so get rid
of it and use WINGs wtrimspace() instead.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Carlos R. Mafra
2012-01-17 15:34:15 +00:00
parent 3c2b3792a6
commit 171eca8b64
2 changed files with 5 additions and 41 deletions

View File

@@ -645,23 +645,6 @@ static void newWSCommand(WMenu * menu, WMenuEntry * foo)
} */
}
static char *cropline(char *line)
{
char *end;
if (strlen(line) == 0)
return line;
end = &(line[strlen(line)]) - 1;
while (isspace(*line) && *line != 0)
line++;
while (isspace(*end) && end != line) {
*end = 0;
end--;
}
return line;
}
void wWorkspaceRename(WScreen * scr, int workspace, char *name)
{
char buf[MAX_WORKSPACENAME_WIDTH + 1];
@@ -671,7 +654,7 @@ void wWorkspaceRename(WScreen * scr, int workspace, char *name)
return;
/* trim white spaces */
tmp = cropline(name);
tmp = wtrimspace(name);
if (strlen(tmp) == 0) {
snprintf(buf, sizeof(buf), _("Workspace %i"), workspace + 1);