Changeset 4613 for trunk/src/target/opkg/libopkg/opkg_cmd.c
- Timestamp:
- 08/27/08 17:32:20 (5 years ago)
- File:
-
- 1 edited
-
trunk/src/target/opkg/libopkg/opkg_cmd.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/target/opkg/libopkg/opkg_cmd.c
r4557 r4613 313 313 { 314 314 opkg_intercept_t ctx; 315 char *oldpath; 315 316 char *newpath; 316 317 int gen; 317 318 318 319 ctx = malloc (sizeof (*ctx)); 319 ctx->oldpath = strdup (getenv ("PATH")); 320 oldpath = getenv ("PATH"); 321 if (oldpath) { 322 ctx->oldpath = strdup (oldpath); 323 } else { 324 ctx->oldpath = 0; 325 } 326 320 327 321 328 sprintf_alloc (&newpath, "%s/opkg/intercept:%s", DATADIR, ctx->oldpath); … … 345 352 int err = 0; 346 353 347 setenv ("PATH", ctx->oldpath, 1); 348 free (ctx->oldpath); 354 if (ctx->oldpath) { 355 setenv ("PATH", ctx->oldpath, 1); 356 free (ctx->oldpath); 357 } else { 358 unsetenv("PATH"); 359 } 349 360 350 361 dir = opendir (ctx->statedir);
Note: See TracChangeset
for help on using the changeset viewer.
