diff options
| author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-02-12 11:25:32 +0000 |
|---|---|---|
| committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-02-12 11:25:32 +0000 |
| commit | f251ec6847d28035ae42ad2c1ae94454d36c36d3 (patch) | |
| tree | 0d7eda9c2c63a73c61b70990db623ffed9eb28df /scripts | |
| parent | c29a0f371a8b5409f79e88f26d00c7d9fc2caa4f (diff) | |
| download | busybox-w32-f251ec6847d28035ae42ad2c1ae94454d36c36d3.tar.gz busybox-w32-f251ec6847d28035ae42ad2c1ae94454d36c36d3.tar.bz2 busybox-w32-f251ec6847d28035ae42ad2c1ae94454d36c36d3.zip | |
- commentary typos
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bb_mkdep.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/scripts/bb_mkdep.c b/scripts/bb_mkdep.c index 758b78cb9..3fea20aed 100644 --- a/scripts/bb_mkdep.c +++ b/scripts/bb_mkdep.c | |||
| @@ -103,9 +103,9 @@ static llist_t *configs; /* list of -c usaged and them stat() after parsed */ | |||
| 103 | static llist_t *Iop; /* list of -I include usaged */ | 103 | static llist_t *Iop; /* list of -I include usaged */ |
| 104 | 104 | ||
| 105 | static char *pwd; /* current work directory */ | 105 | static char *pwd; /* current work directory */ |
| 106 | static size_t replace; /* replace current work derectory to build dir */ | 106 | static size_t replace; /* replace current work directory with build dir */ |
| 107 | 107 | ||
| 108 | static const char *kp; /* KEY path, argument of -k usaged */ | 108 | static const char *kp; /* KEY path, argument of -k used */ |
| 109 | static size_t kp_len; | 109 | static size_t kp_len; |
| 110 | static struct stat st_kp; /* stat(kp) */ | 110 | static struct stat st_kp; /* stat(kp) */ |
| 111 | 111 | ||
| @@ -197,7 +197,7 @@ static void c_lex(const char *fname, long fsize) | |||
| 197 | int state; | 197 | int state; |
| 198 | int line; | 198 | int line; |
| 199 | char *id = id_s; | 199 | char *id = id_s; |
| 200 | size_t id_len = 0; /* stupid initialize */ | 200 | size_t id_len = 0; /* stupid initialization */ |
| 201 | unsigned char *optr, *oend; | 201 | unsigned char *optr, *oend; |
| 202 | 202 | ||
| 203 | int fd; | 203 | int fd; |
| @@ -328,7 +328,7 @@ static void c_lex(const char *fname, long fsize) | |||
| 328 | put_id(c); | 328 | put_id(c); |
| 329 | getc1(); | 329 | getc1(); |
| 330 | } | 330 | } |
| 331 | /* have str begined with c, readed == strlen key and compared */ | 331 | /* str begins with c, read == strlen key and compared */ |
| 332 | if(diu == id_len && !memcmp(id, preproc[diu], diu)) { | 332 | if(diu == id_len && !memcmp(id, preproc[diu], diu)) { |
| 333 | state = diu + '0'; | 333 | state = diu + '0'; |
| 334 | id_len = 0; /* common for save */ | 334 | id_len = 0; /* common for save */ |
| @@ -427,7 +427,7 @@ too_long: | |||
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | 429 | ||
| 430 | /* bb_simplify_path special variant for apsolute pathname */ | 430 | /* bb_simplify_path special variant for absolute pathname */ |
| 431 | static size_t bb_qa_simplify_path(char *path) | 431 | static size_t bb_qa_simplify_path(char *path) |
| 432 | { | 432 | { |
| 433 | char *s, *p; | 433 | char *s, *p; |
| @@ -477,7 +477,7 @@ static void parse_inc(const char *include, const char *fname) | |||
| 477 | const char *p; | 477 | const char *p; |
| 478 | 478 | ||
| 479 | lo = Iop; | 479 | lo = Iop; |
| 480 | p = strrchr(fname, '/'); /* fname have absolute pathname */ | 480 | p = strrchr(fname, '/'); /* fname has absolute pathname */ |
| 481 | w = (p-fname); | 481 | w = (p-fname); |
| 482 | /* find from current directory of source file */ | 482 | /* find from current directory of source file */ |
| 483 | ap = bb_asprint("%.*s/%s", w, fname, include); | 483 | ap = bb_asprint("%.*s/%s", w, fname, include); |
| @@ -502,15 +502,14 @@ static void parse_inc(const char *include, const char *fname) | |||
| 502 | 502 | ||
| 503 | /* find from "-I include" specified directories */ | 503 | /* find from "-I include" specified directories */ |
| 504 | free(ap); | 504 | free(ap); |
| 505 | /* lo->data have absolute pathname */ | 505 | /* lo->data has absolute pathname */ |
| 506 | ap = bb_asprint("%s/%s", lo->data, include); | 506 | ap = bb_asprint("%s/%s", lo->data, include); |
| 507 | lo = lo->link; | 507 | lo = lo->link; |
| 508 | } | 508 | } |
| 509 | 509 | ||
| 510 | cur = xmalloc(sizeof(bb_key_t)); | 510 | cur = xmalloc(sizeof(bb_key_t)); |
| 511 | cur->keyname = ap; | 511 | cur->keyname = cur->stored_path = ap; |
| 512 | cur->key_sz = key_sz; | 512 | cur->key_sz = key_sz; |
| 513 | cur->stored_path = ap; | ||
| 514 | cur->value = cur->checked = p_i; | 513 | cur->value = cur->checked = p_i; |
| 515 | if(p_i == NULL && noiwarning) | 514 | if(p_i == NULL && noiwarning) |
| 516 | fprintf(stderr, "%s: Warning: #include \"%s\" not found\n", fname, include); | 515 | fprintf(stderr, "%s: Warning: #include \"%s\" not found\n", fname, include); |
| @@ -529,7 +528,7 @@ static void parse_conf_opt(const char *opt, const char *val, size_t key_sz) | |||
| 529 | 528 | ||
| 530 | cur = check_key(key_top, opt, key_sz); | 529 | cur = check_key(key_top, opt, key_sz); |
| 531 | if(cur != NULL) { | 530 | if(cur != NULL) { |
| 532 | /* present already */ | 531 | /* already present */ |
| 533 | cur->checked = NULL; /* store only */ | 532 | cur->checked = NULL; /* store only */ |
| 534 | if(cur->value == NULL && val == NULL) | 533 | if(cur->value == NULL && val == NULL) |
| 535 | return; | 534 | return; |
| @@ -569,7 +568,7 @@ static void parse_conf_opt(const char *opt, const char *val, size_t key_sz) | |||
| 569 | first_chars[(int)*k] = *k; | 568 | first_chars[(int)*k] = *k; |
| 570 | 569 | ||
| 571 | cur->stored_path = k = bb_asprint("%s/%s.h", kp, k); | 570 | cur->stored_path = k = bb_asprint("%s/%s.h", kp, k); |
| 572 | /* key converting [A-Z_] -> [a-z/] */ | 571 | /* key conversion [A-Z_] -> [a-z/] */ |
| 573 | for(p = k + kp_len + 1; *p; p++) { | 572 | for(p = k + kp_len + 1; *p; p++) { |
| 574 | if(*p >= 'A' && *p <= 'Z') | 573 | if(*p >= 'A' && *p <= 'Z') |
| 575 | *p = *p - 'A' + 'a'; | 574 | *p = *p - 'A' + 'a'; |
| @@ -605,7 +604,7 @@ static void store_keys(void) | |||
| 605 | } | 604 | } |
| 606 | /* size_t -> ssize_t :( */ | 605 | /* size_t -> ssize_t :( */ |
| 607 | rw_ret = (ssize_t)recordsz; | 606 | rw_ret = (ssize_t)recordsz; |
| 608 | /* check kp/key.h, compare after previous usage */ | 607 | /* check kp/key.h, compare after previous use */ |
| 609 | cmp_ok = 0; | 608 | cmp_ok = 0; |
| 610 | k = cur->stored_path; | 609 | k = cur->stored_path; |
| 611 | if(stat(k, &st)) { | 610 | if(stat(k, &st)) { |
| @@ -741,7 +740,7 @@ parse_chd(const char *fe, const char *p, size_t dirlen) | |||
| 741 | return NULL; | 740 | return NULL; |
| 742 | } | 741 | } |
| 743 | 742 | ||
| 744 | /* from libbb but inline for fast */ | 743 | /* from libbb but inlined for speed considerations */ |
| 745 | static inline llist_t *llist_add_to(llist_t *old_head, char *new_item) | 744 | static inline llist_t *llist_add_to(llist_t *old_head, char *new_item) |
| 746 | { | 745 | { |
| 747 | llist_t *new_head; | 746 | llist_t *new_head; |
| @@ -764,7 +763,7 @@ static void scan_dir_find_ch_files(const char *p) | |||
| 764 | 763 | ||
| 765 | dirs = llist_add_to(NULL, bb_simplify_path(p)); | 764 | dirs = llist_add_to(NULL, bb_simplify_path(p)); |
| 766 | replace = strlen(dirs->data); | 765 | replace = strlen(dirs->data); |
| 767 | /* emulate recursive */ | 766 | /* emulate recursion */ |
| 768 | while(dirs) { | 767 | while(dirs) { |
| 769 | d_add = NULL; | 768 | d_add = NULL; |
| 770 | while(dirs) { | 769 | while(dirs) { |
| @@ -804,7 +803,7 @@ int main(int argc, char **argv) | |||
| 804 | llist_t *fl; | 803 | llist_t *fl; |
| 805 | 804 | ||
| 806 | { | 805 | { |
| 807 | /* for bb_simplify_path, this program have not chdir() */ | 806 | /* for bb_simplify_path, this program has no chdir() */ |
| 808 | /* libbb-like my xgetcwd() */ | 807 | /* libbb-like my xgetcwd() */ |
| 809 | unsigned path_max = 512; | 808 | unsigned path_max = 512; |
| 810 | 809 | ||
| @@ -864,7 +863,7 @@ int main(int argc, char **argv) | |||
| 864 | for(i = 0; i < UCHAR_MAX; i++) { | 863 | for(i = 0; i < UCHAR_MAX; i++) { |
| 865 | if(ISALNUM(i)) | 864 | if(ISALNUM(i)) |
| 866 | isalnums[i] = i; | 865 | isalnums[i] = i; |
| 867 | /* set unparsed chars for speed up of parser */ | 866 | /* set unparsed chars to speed up the parser */ |
| 868 | else if(i != CHR && i != STR && i != POUND && i != REM) | 867 | else if(i != CHR && i != STR && i != POUND && i != REM) |
| 869 | first_chars[i] = ANY; | 868 | first_chars[i] = ANY; |
| 870 | } | 869 | } |
| @@ -924,7 +923,6 @@ static char *bb_asprint(const char *format, ...) | |||
| 924 | } | 923 | } |
| 925 | 924 | ||
| 926 | /* partial libbb routine as is */ | 925 | /* partial libbb routine as is */ |
| 927 | |||
| 928 | static char *bb_simplify_path(const char *path) | 926 | static char *bb_simplify_path(const char *path) |
| 929 | { | 927 | { |
| 930 | char *s, *start, *p; | 928 | char *s, *start, *p; |
| @@ -932,7 +930,7 @@ static char *bb_simplify_path(const char *path) | |||
| 932 | if (path[0] == '/') | 930 | if (path[0] == '/') |
| 933 | start = bb_xstrdup(path); | 931 | start = bb_xstrdup(path); |
| 934 | else { | 932 | else { |
| 935 | /* is not libbb, but this program have not chdir() */ | 933 | /* is not libbb, but this program has no chdir() */ |
| 936 | start = bb_asprint("%s/%s", pwd, path); | 934 | start = bb_asprint("%s/%s", pwd, path); |
| 937 | } | 935 | } |
| 938 | p = s = start; | 936 | p = s = start; |
