Changeset ed2412d for functions.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.