Last change
on this file since 3858 was 3621, checked in by Bruno Cornec, 8 years ago |
New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.
|
-
Property svn:eol-style
set to
native
|
File size:
486 bytes
|
Rev | Line | |
---|
[3621] | 1 | /*
|
---|
| 2 | * Utility routines.
|
---|
| 3 | *
|
---|
| 4 | * Copyright (C) 2013 Denys Vlasenko
|
---|
| 5 | *
|
---|
| 6 | * Licensed under GPLv2, see file LICENSE in this source tree.
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | //kbuild:lib-y += endofname.o
|
---|
| 10 |
|
---|
| 11 | #include "libbb.h"
|
---|
| 12 |
|
---|
| 13 | #define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
|
---|
| 14 | #define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
|
---|
| 15 |
|
---|
| 16 | const char* FAST_FUNC
|
---|
| 17 | endofname(const char *name)
|
---|
| 18 | {
|
---|
| 19 | if (!is_name(*name))
|
---|
| 20 | return name;
|
---|
| 21 | while (*++name) {
|
---|
| 22 | if (!is_in_name(*name))
|
---|
| 23 | break;
|
---|
| 24 | }
|
---|
| 25 | return name;
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.