Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
625 bytes
|
Line | |
---|
1 | /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. |
---|
2 | * |
---|
3 | * Permission to use, copy, modify, and distribute this software |
---|
4 | * is freely granted, provided that this notice is preserved. |
---|
5 | */ |
---|
6 | |
---|
7 | #include <stddef.h> |
---|
8 | #include <argz.h> |
---|
9 | #include <sys/types.h> |
---|
10 | |
---|
11 | void |
---|
12 | argz_extract (char *argz, |
---|
13 | size_t argz_len, |
---|
14 | char **argv) |
---|
15 | { |
---|
16 | size_t i = 0; |
---|
17 | int j = 0; |
---|
18 | const size_t count = argz_count(argz, argz_len); |
---|
19 | |
---|
20 | if (argz_len > 1) |
---|
21 | for (i = argz_len - 2; i > 0; i--) |
---|
22 | { |
---|
23 | if (argz[i] == '\0') |
---|
24 | { |
---|
25 | j++; |
---|
26 | argv[count - j] = &argz[i + 1]; |
---|
27 | } |
---|
28 | } |
---|
29 | argv[0] = &argz[0]; |
---|
30 | argv[count] = NULL; |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.