- Timestamp:
- Aug 11, 2005 9:29:40 PM (19 years ago)
- Location:
- trunk/src/gmake
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/Makefile.kmk
r302 r311 20 20 CONFIG_NO_DEFAULT_SUFFIX_RULES \ 21 21 CONFIG_NO_DEFAULT_VARIABLES \ 22 KMK 22 23 23 24 kmk_SOURCES = \ -
trunk/src/gmake/function.c
r303 r311 1784 1784 if (!dest) 1785 1785 return NULL; 1786 { 1787 size_t len = strlen(dest); 1788 memcpy(apath, dest, len); 1789 dest = apath + len; 1790 } 1791 1786 1792 (void)end; (void)start; (void)apath_limit; 1787 return strcpy(apath, dest);1788 1793 1789 1794 #elif defined __OS2__ 1790 1795 if (!_fullpath(apath, name, GET_PATH_MAX)) 1791 1796 return NULL; 1797 dest = strchr(apath, '\0'); 1798 1792 1799 (void)end; (void)start; (void)apath_limit; (void)dest; 1793 return apath;1794 1800 1795 1801 #else /* !WINDOWS32 && !__OS2__ */ … … 1860 1866 } 1861 1867 } 1868 #endif /* !WINDOWS32 && !__OS2__ */ 1862 1869 1863 1870 /* Unless it is root strip trailing separator. */ 1871 #ifdef HAVE_DOS_PATHS 1872 if (dest > apath + 1 + (apath[0] != '/') && dest[-1] == '/') 1873 #else 1864 1874 if (dest > apath + 1 && dest[-1] == '/') 1875 #endif 1865 1876 --dest; 1866 1877 … … 1868 1879 1869 1880 return apath; 1870 #endif /* !WINDOWS32 */1871 1881 } 1872 1882 … … 1946 1956 return o; 1947 1957 } 1958 1959 #ifdef KMK 1960 static char * 1961 func_toupper_tolower (char *o, char **argv, const char *funcname) 1962 { 1963 /* Expand the argument. */ 1964 char *p = argv[0]; 1965 while (*p) 1966 { 1967 /* convert to temporary buffer */ 1968 char tmp[256]; 1969 unsigned int i; 1970 if (!strcmp(funcname, "toupper")) 1971 for (i = 0; i < sizeof(tmp) && tmp[i]; i++, p++) 1972 tmp[i] = toupper(*p); 1973 else 1974 for (i = 0; i < sizeof(tmp) && tmp[i]; i++, p++) 1975 tmp[i] = tolower(*p); 1976 o = variable_buffer_output (o, tmp, i); 1977 } 1978 1979 return o; 1980 } 1981 #endif 1948 1982 1949 1983 /* Lookup table for builtin functions. … … 2001 2035 { STRING_SIZE_TUPLE("not"), 0, 1, 1, func_not}, 2002 2036 #endif 2037 #ifdef KMK 2038 { STRING_SIZE_TUPLE("toupper"), 0, 1, 1, func_toupper_tolower}, 2039 { STRING_SIZE_TUPLE("tolower"), 0, 1, 1, func_toupper_tolower}, 2040 #endif 2003 2041 }; 2004 2042 -
trunk/src/gmake/variable.c
r303 r311 681 681 682 682 /* Define KMK_FEATURES to indicate various working KMK features. */ 683 (void) define_variable ("KMK_FEATURES", 12, "abspath ", o_default, 0);683 (void) define_variable ("KMK_FEATURES", 12, "abspath toupper tolower", o_default, 0); 684 684 685 685 #ifdef CONFIG_WITH_KMK_BUILTIN
Note:
See TracChangeset
for help on using the changeset viewer.