File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -21,32 +21,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21
21
22
22
#include "./gridinit_internals.h"
23
23
24
- #define STR_SKIP_SPACES (s ) do {\
25
- register gchar c;\
26
- for (; (c = *s) && g_ascii_isspace(c) ;++s);\
27
- } while (0)
28
-
29
- #define STR_TRIM_TRAILING_SPACES (s ) do { \
30
- register gchar c, *end; \
31
- for (end = s; *end ;++end); \
32
- -- end; \
33
- for (; end > s && (c = *end) && g_ascii_isspace(c) ;--end) *end = '\0'; \
34
- } while (0)
35
-
36
24
gboolean
37
25
gridinit_group_in_set (const gchar * group , const gchar * set )
38
26
{
39
- gchar * * tokens , * * token , * g ;
40
-
41
- tokens = g_strsplit_set (set , "," , -1 );
27
+ gchar * * tokens = g_strsplit_set (set , "," , -1 );
42
28
if (!tokens )
43
29
return 0 ;
44
- for (token = tokens ; (g = * token ) ;token ++ ) {
45
- STR_SKIP_SPACES (g );
46
- STR_TRIM_TRAILING_SPACES (g );
30
+ for (gchar * * ptoken = tokens ; * ptoken ;ptoken ++ ) {
31
+ gchar * g = * ptoken ;
47
32
if (!* g )
48
33
continue ;
49
- if (0 == g_ascii_strcasecmp (g , group )) {
34
+ if (0 == g_ascii_strcasecmp (g_strstrip ( g ) , group )) {
50
35
g_strfreev (tokens );
51
36
return TRUE;
52
37
}
You can’t perform that action at this time.
0 commit comments