- Timestamp:
- Mar 29, 2009, 3:08:14 PM (16 years ago)
- Branches:
- owl
- Children:
- a0bde15
- Parents:
- 2ace81e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
rfa00c5c r2f01162 765 765 } 766 766 767 /* Return the base class or instance from a zephyr class, by removing 768 leading `un' or trailing `.d'. 769 The caller is responsible for freeing the allocated string. 770 */ 771 char * owl_util_baseclass(char * class) 772 { 773 char *start, *end; 774 775 start = class; 776 while(!strncmp(start, "un", 2)) { 777 start += 2; 778 } 779 780 start = owl_strdup(start); 781 end = start + strlen(start) - 1; 782 while(end > start && *end == 'd' && *(end-1) == '.') { 783 end -= 2; 784 } 785 *(end + 1) = 0; 786 787 return start; 788 } 789 767 790 /**************************************************************************/ 768 791 /************************* REGRESSION TESTS *******************************/
Note: See TracChangeset
for help on using the changeset viewer.