- Timestamp:
- Feb 23, 2007, 3:12:49 PM (18 years ago)
- Branches:
- master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 59916e8
- Parents:
- 1cc95709
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
util.c
r7a20e4c rbe5aa09 739 739 /* Return the base class or instance from a zephyr class, by removing 740 740 leading `un' or trailing `.d'. 741 Modified ``class'' in place, and does not allocate memory.741 The caller is responsible for freeing the allocated string. 742 742 */ 743 743 char * owl_util_baseclass(char * class) 744 744 { 745 char * newClass; 745 746 char * end; 746 while(!strncmp(class, "un", 2)) { 747 class += 2; 748 } 749 end = class + strlen(class) - 1; 747 newClass = owl_strdup(class); 748 while(!strncmp(newClass, "un", 2)) { 749 newClass += 2; 750 } 751 end = newClass + strlen(newClass) - 1; 750 752 while(*end == 'd' && *(end-1) == '.') { 751 753 end -= 2; 752 754 } 753 755 *(end + 1) = 0; 754 return class;756 return newClass; 755 757 } 756 758
Note: See TracChangeset
for help on using the changeset viewer.