Changeset ed2412d
- Timestamp:
- Feb 21, 2003, 11:30:23 AM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 2e6d137
- Parents:
- 7933748
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r7933748 red2412d 27 27 Added a 'loadsubs' command to eventually phase out the 'load-subs' 28 28 command 29 Made M-n work on classes and instances with spaces in them 29 30 30 31 1.2.8 -
functions.c
r7933748 red2412d 1965 1965 owl_filter *f; 1966 1966 char *argbuff, *filtname; 1967 char *tmpclass, *tmpinstance; 1967 1968 int len; 1968 1969 … … 1978 1979 sprintf(filtname, "class-%s-instance-%s", class, instance); 1979 1980 } 1981 /* downcase it */ 1980 1982 downstr(filtname); 1981 1983 /* turn spaces into hyphens */ 1984 owl_util_tr(filtname, ' ', '.'); 1985 1982 1986 /* if it already exists then go with it. This lets users override */ 1983 1987 if (owl_global_get_filter(&g, filtname)) { 1984 return filtname;1988 return(filtname); 1985 1989 } 1986 1990 1987 1991 /* create the new filter */ 1988 1992 argbuff=owl_malloc(len+20); 1989 sprintf(argbuff, "( class ^%s$ )", class); 1993 tmpclass=owl_strdup(class); 1994 owl_util_tr(tmpclass, ' ', '.'); 1990 1995 if (instance) { 1991 sprintf(argbuff, "%s and ( instance ^%s$ )", argbuff, instance); 1992 } 1996 tmpinstance=owl_strdup(instance); 1997 owl_util_tr(tmpinstance, ' ', '.'); 1998 } 1999 sprintf(argbuff, "( class ^%s$ )", tmpclass); 2000 if (instance) { 2001 sprintf(argbuff, "%s and ( instance ^%s$ )", argbuff, tmpinstance); 2002 } 2003 owl_free(tmpclass); 2004 if (instance) owl_free(tmpinstance); 1993 2005 1994 2006 f=owl_malloc(sizeof(owl_filter)); … … 1999 2011 2000 2012 owl_free(argbuff); 2001 return filtname;2013 return(filtname); 2002 2014 } 2003 2015 … … 2016 2028 /* if it already exists then go with it. This lets users override */ 2017 2029 if (owl_global_get_filter(&g, filtname)) { 2018 return filtname;2030 return(filtname); 2019 2031 } 2020 2032 … … 2037 2049 owl_free(shortuser); 2038 2050 2039 return filtname;2051 return(filtname); 2040 2052 } 2041 2053 -
util.c
r7e3e00a red2412d 507 507 } 508 508 509 void owl_util_tr(char *buff, char a, char b) { 510 /* replace all instances of character a in buff with the character 511 b. buff must be null terminated */ 512 int i; 513 514 owl_function_debugmsg("In: %s", buff); 515 for (i=0; buff[i]!='\0'; i++) { 516 if (buff[i]==a) buff[i]=b; 517 } 518 owl_function_debugmsg("Out: %s", buff); 519 } 509 520 510 521 int owl_util_string_to_color(char *color) {
Note: See TracChangeset
for help on using the changeset viewer.