diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-13 01:45:43 -0500 |
commit | 5cbb3d216e2041700231bcfc383ee5f8b7fc8b74 (patch) | |
tree | a738fa82dbcefa9bd283c08bc67f38827be63937 /usr/gen_init_cpio.c | |
parent | 9bc9ccd7db1c9f043f75380b5a5b94912046a60e (diff) | |
parent | 4e9b45a19241354daec281d7a785739829b52359 (diff) |
Merge branch 'akpm' (patches from Andrew Morton)
Merge first patch-bomb from Andrew Morton:
"Quite a lot of other stuff is banked up awaiting further
next->mainline merging, but this batch contains:
- Lots of random misc patches
- OCFS2
- Most of MM
- backlight updates
- lib/ updates
- printk updates
- checkpatch updates
- epoll tweaking
- rtc updates
- hfs
- hfsplus
- documentation
- procfs
- update gcov to gcc-4.7 format
- IPC"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (269 commits)
ipc, msg: fix message length check for negative values
ipc/util.c: remove unnecessary work pending test
devpts: plug the memory leak in kill_sb
./Makefile: export initial ramdisk compression config option
init/Kconfig: add option to disable kernel compression
drivers: w1: make w1_slave::flags long to avoid memory corruption
drivers/w1/masters/ds1wm.cuse dev_get_platdata()
drivers/memstick/core/ms_block.c: fix unreachable state in h_msb_read_page()
drivers/memstick/core/mspro_block.c: fix attributes array allocation
drivers/pps/clients/pps-gpio.c: remove redundant of_match_ptr
kernel/panic.c: reduce 1 byte usage for print tainted buffer
gcov: reuse kbasename helper
kernel/gcov/fs.c: use pr_warn()
kernel/module.c: use pr_foo()
gcov: compile specific gcov implementation based on gcc version
gcov: add support for gcc 4.7 gcov format
gcov: move gcov structs definitions to a gcc version specific file
kernel/taskstats.c: return -ENOMEM when alloc memory fails in add_del_listener()
kernel/taskstats.c: add nla_nest_cancel() for failure processing between nla_nest_start() and nla_nest_end()
kernel/sysctl_binary.c: use scnprintf() instead of snprintf()
...
Diffstat (limited to 'usr/gen_init_cpio.c')
-rw-r--r-- | usr/gen_init_cpio.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c index af8c925e93eb..225ad244cf88 100644 --- a/usr/gen_init_cpio.c +++ b/usr/gen_init_cpio.c | |||
@@ -382,24 +382,15 @@ error: | |||
382 | static char *cpio_replace_env(char *new_location) | 382 | static char *cpio_replace_env(char *new_location) |
383 | { | 383 | { |
384 | char expanded[PATH_MAX + 1]; | 384 | char expanded[PATH_MAX + 1]; |
385 | char env_var[PATH_MAX + 1]; | 385 | char *start, *end, *var; |
386 | char *start; | 386 | |
387 | char *end; | 387 | while ((start = strstr(new_location, "${")) && |
388 | 388 | (end = strchr(start + 2, '}'))) { | |
389 | for (start = NULL; (start = strstr(new_location, "${")); ) { | 389 | *start = *end = 0; |
390 | end = strchr(start, '}'); | 390 | var = getenv(start + 2); |
391 | if (start < end) { | 391 | snprintf(expanded, sizeof expanded, "%s%s%s", |
392 | *env_var = *expanded = '\0'; | 392 | new_location, var ? var : "", end + 1); |
393 | strncat(env_var, start + 2, end - start - 2); | 393 | strcpy(new_location, expanded); |
394 | strncat(expanded, new_location, start - new_location); | ||
395 | strncat(expanded, getenv(env_var), | ||
396 | PATH_MAX - strlen(expanded)); | ||
397 | strncat(expanded, end + 1, | ||
398 | PATH_MAX - strlen(expanded)); | ||
399 | strncpy(new_location, expanded, PATH_MAX); | ||
400 | new_location[PATH_MAX] = 0; | ||
401 | } else | ||
402 | break; | ||
403 | } | 394 | } |
404 | 395 | ||
405 | return new_location; | 396 | return new_location; |