Changeset 1298 for trunk/src/kmk/kbuild.c
- Timestamp:
- Dec 1, 2007, 9:11:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kbuild.c
r1128 r1298 134 134 szTmp[rc] = '\0'; 135 135 } 136 136 137 137 #elif defined(WINDOWS32) 138 138 if (GetModuleFileName(GetModuleHandle(NULL), szTmp, GET_PATH_MAX)) … … 167 167 break; 168 168 } 169 } 169 } 170 170 171 171 /* next */ … … 176 176 free(pszCopy); 177 177 } 178 #endif 178 #endif 179 179 180 180 if (rc < 0) … … 204 204 * Determin the PATH_KBUILD value. 205 205 * 206 * @returns Pointer to static buffer to be treated as read only!206 * @returns Pointer to static a buffer containing the value (consider it read-only). 207 207 */ 208 208 const char *get_path_kbuild(void) … … 236 236 * Determin the PATH_KBUILD_BIN value. 237 237 * 238 * @returns Pointer to static buffer to be treated as read only!238 * @returns Pointer to static a buffer containing the value (consider it read-only). 239 239 */ 240 240 const char *get_path_kbuild_bin(void) … … 276 276 } 277 277 278 279 /** 280 * Determin the location of default kBuild shell. 281 * 282 * @returns Pointer to static a buffer containing the location (consider it read-only). 283 */ 284 const char *get_default_kbuild_shell(void) 285 { 286 static char *s_pszDefaultShell = NULL; 287 if (!s_pszDefaultShell) 288 { 289 #if defined(__OS2__) || defined(_WIN32) || defined(WINDOWS32) 290 static const char s_szShellName[] = "/kmk_ash.exe"; 291 #else 292 static const char s_szShellName[] = "/kmk_ash"; 293 #endif 294 const char *pszBin = get_path_kbuild_bin(); 295 size_t cchBin = strlen(pszBin); 296 s_pszDefaultShell = xmalloc(cchBin + sizeof(s_szShellName)); 297 memcpy(s_pszDefaultShell, pszBin, cchBin); 298 memcpy(&s_pszDefaultShell[cchBin], s_szShellName, sizeof(s_szShellName)); 299 } 300 return s_pszDefaultShell; 301 } 278 302 279 303 #ifdef KMK_HELPERS
Note:
See TracChangeset
for help on using the changeset viewer.