Changeset da680b4b in mainline for uspace/lib/c/generic/str.c
- Timestamp:
- 2018-07-06T17:18:28Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6419c6e
- Parents:
- 9ba040a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r9ba040a rda680b4b 1134 1134 return (char *) (str + last); 1135 1135 last = off; 1136 } 1137 1138 return NULL; 1139 } 1140 1141 /** Find first occurence of substring in string. 1142 * 1143 * @param hs Haystack (string) 1144 * @param n Needle (substring to look for) 1145 * 1146 * @return Pointer to character in @a hs or @c NULL if not found. 1147 */ 1148 char *str_str(const char *hs, const char *n) 1149 { 1150 size_t off = 0; 1151 1152 if (str_lcmp(hs, n, str_length(n)) == 0) 1153 return (char *)hs; 1154 1155 while (str_decode(hs, &off, STR_NO_LIMIT) != 0) { 1156 if (str_lcmp(hs + off, n, str_length(n)) == 0) 1157 return (char *)(hs + off); 1136 1158 } 1137 1159
Note:
See TracChangeset
for help on using the changeset viewer.