Index: man/man/Makefile diff -u man/man/Makefile:1.1.1.1 man/man/Makefile:1.2 --- man/man/Makefile:1.1.1.1 Tue Jul 17 10:34:22 2001 +++ man/man/Makefile Tue Jul 17 10:42:52 2001 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.1.1.1 2001/07/17 01:34:22 mori Exp $ +# $Id: Makefile,v 1.2 2001/07/17 01:42:52 mori Exp $ # # Japanized by # Copyright (c) KUMANO, Tadashi , 1996-2001, @@ -7,7 +7,7 @@ # (version 1.1i 2001/01/15) PROG= jman -SRCS= man.c manpath.c glob.c +SRCS= man.c manpath.c glob.c locale.c MAN1= jman.1 EMAN1= jman.1.eng.gz BINOWN= man @@ -55,6 +55,8 @@ .else afterinstall: .endif + +man.o locale.o: locale.h .include "../Makefile.inc" Index: man/man/README.jman-ex diff -u /dev/null man/man/README.jman-ex:1.2 --- /dev/null Mon Aug 27 09:02:06 2001 +++ man/man/README.jman-ex Thu Jul 26 15:25:56 2001 @@ -0,0 +1,39 @@ +デフォルトでは en と ja がサポートされている。 + +環境変数 + +JMAN_SEARCH + マニュアルを検索する言語のリストを '%', ':' で区切って列挙する。 + グループの区切りは '%'、メンバーの区切りは ':' である。 + '%' で区切られたグループごとに manpath は始めから検索される。 + ':' で区切られたメンバーは manpath の各要素ごとに検索される。 + 例えば JMAN_SEARCH が "ja:en%fr:ru" の場合、manpath の + 各要素ごとに「日本語」「英語」のマニュアルがこの順で検索される。 + すべての manpath の検索が終了してもなおマニュアルが見つからない場合に + 「フランス語」「ロシア語」のマニュアルの検索が行なわれる。 + + この仕様は異なるセクションのマニュアルが部分的に存在する場合の + 動作に影響を与える。英語版の man.1, man.7 と日本語版の man.7 が + インストールされたシステムでは ja%en の場合は日本語版の man.7 が、 + ja:en の場合は英語版の man.1 が表示される。 + +JMAN__PATH + マニュアルが実際にインストールされているサブディレクトリのリスト。 + は JMAN_SEARCH で指定したメンバー名を大文字にしたもの + である。デリミタは ':'。JMAN_SEARCH で日本語のマニュアルを + 検索順序を ja で指定したならこの環境変数は JMAN_JA_PATH となる。 + 日本語のマニュアルのサブディレクトリを ja, ja_JP.EUC, ja_JP.eucJP + の順で検索する時は JMAN_JA_PATH=ja:ja_JP.EUC:ja_JP.eucJP と + 指定する。 + +JMAN__ + マニュアルを整形するときに使用するコマンドをオプションつきで指定する。 + には TROFF, NROFF, EQN, NEQN, GRAP, PIC, TBL, VGRIND, + REFER, COL, PAGER がある。 + +JMAN__TEMPLATE + を指定する時のテンプレートとなる言語環境名を指定する。 + JMAN_RU_TEMPLATE=ja とすると明示的に指定しなかった directive には + ja 環境の directive がコピーされる。 + + $Id: README.jman-ex,v 1.2 2001/07/26 06:25:56 mori Exp $ Index: man/man/locale.c diff -u /dev/null man/man/locale.c:1.5 --- /dev/null Mon Aug 27 09:02:06 2001 +++ man/man/locale.c Mon Aug 27 09:01:55 2001 @@ -0,0 +1,278 @@ +/* $Id: locale.c,v 1.5 2001/08/27 00:01:55 mori Exp $ */ + +#include +#include +#include +#include "gripes.h" +#include "locale.h" + +#define ENV_PREFIX "JMAN" +#define MAX_SUPPORT_LANG 255 +#define MAX_SUPPORT_LANG_DIRS 255 + +int debug; +int insecure = 0; +int findall; +char *search_lang_path = "ja%en"; + +typedef struct { + char *name; + char **path; + char **directive; +} man_lang_env_t; + +static man_lang_env_t **current_locale_list_root, *current_locale_set; + +static char *search_path_en[] = { "", NULL }; +static char *search_path_ja[] = { "ja", "ja_JP.EUC", "ja_JP.eucJP", NULL }; +static char *directive_en[] = { + "/usr/bin/groff -S -man", + "/usr/bin/groff -S -Wall -mtty-char -man -Tascii", + "/usr/bin/eqn", + "/usr/bin/neqn", + "", /* grap */ + "/usr/bin/pic", + "/usr/bin/tbl", + "/usr/bin/vgrind", + "/usr/bin/refer", + "/usr/bin/col", + "more -s", + NULL +}; +static char *directive_ja[] = { + "/usr/local/bin/groff -man -dlang=ja_JP.eucJP", + "/usr/local/bin/groff -S -Wall -mtty-char -man -Tnippon -dlang=ja_JP.eucJP", + "/usr/local/bin/geqn", + "/usr/local/bin/gneqn", + "", /* grap */ + "/usr/local/bin/gpic", + "/usr/local/bin/gtbl", + "/usr/bin/vgrind", + "/usr/bin/refer", + "", /* col */ + "jless -sEX", + NULL +}; +static char *directive_list[] = { + "TROFF", "NROFF", "EQN", "NEQN", "GRAP", "PIC", "TBL", "VGRIND", + "REFER", "COL", "PAGER", NULL +}; + +static man_lang_env_t lang_env_en = { "en", search_path_en, directive_en }; +static man_lang_env_t lang_env_ja = { "ja", search_path_ja, directive_ja }; + +static man_lang_env_t *lang_env_list[MAX_SUPPORT_LANG + 1] = + { &lang_env_en, &lang_env_ja, NULL }; + +static void convert_path(char **list, char *path, char *delimiter, int max) +{ + int i, j; + + for (i = 0; i < max - 1; i++) { + if (debug) + fprintf(stderr, " path = %s", path); + retry: + if ((list[i] = strsep(&path, delimiter)) == NULL) + break; + for (j = 0; j < i; j++) + if (strcmp(list[j], list[i]) == 0) + goto retry; + if (debug) { + fprintf(stderr, "\titem = \"%s\"\trest = \"%s\"\n", list[i], path); + } + } + list[max - 1] = NULL; + if (debug) + fprintf(stderr, "\n"); + return; +} + +static man_lang_env_t *get_lang_env(char *lang) +{ + man_lang_env_t **p; + + if (lang == NULL) + return NULL; + for (p = lang_env_list; *p; p++) + if (strcmp((*p)->name, lang) == 0) + return *p; + return NULL; +} + +static man_lang_env_t *new_lang_env(char *lang) +{ + man_lang_env_t *p, **q, *default_lang_env; + char buf[BUFSIZ]; + char lang_upper[BUFSIZ], *s, *t; + char *path; + char **d_name, **d_dst, **d_src; + int exist = 0; + + for (s = lang, t = lang_upper; *s; s++, t++) + *t = toupper(*s); + *t = '\0'; + + if (debug) + fprintf(stderr, "create new lang env set \"%s\".\n", lang); + + if ((p = get_lang_env(lang)) == NULL) { + for (q = lang_env_list; *q; q++) ; + if ((p = *q = (man_lang_env_t *)malloc(sizeof(man_lang_env_t))) == NULL) + gripe_alloc(sizeof(man_lang_env_t), "lang_env"); + p->name = lang; + if ((p->path = + (char **)malloc(sizeof(char *) * MAX_SUPPORT_LANG_DIRS + 1)) == NULL) + gripe_alloc(sizeof(char *) * MAX_SUPPORT_LANG_DIRS + 1, "lang_env"); + if ((p->directive = + (char **)malloc(sizeof(char *) * N_DIRECTIVE + 1)) == NULL) + gripe_alloc(sizeof(char *) * N_DIRECTIVE + 1, "lang_env"); + *(q + 1) = NULL; + } else { + exist = 1; + if (debug) { + fprintf(stderr, "exist\n"); + fprintf(stderr, " p = %0x\n", p); + fprintf(stderr, " p->name = \"%s\"\n", p->name); + fprintf(stderr, " p->directive[0] = \"%s\"\n", p->directive[0]); + } + } + + snprintf(buf, sizeof(buf), ENV_PREFIX "_%s_TEMPLATE", lang_upper); + if ((default_lang_env = get_lang_env(getenv(buf))) == NULL) + default_lang_env = get_lang_env("en"); + + snprintf(buf, sizeof(buf), ENV_PREFIX "_%s_PATH", lang_upper); + if ((s = getenv(buf)) != NULL) { + if (debug) + fprintf(stderr, "found path: \"%s\"\n", s); + if ((path = (char *)malloc(sizeof(char) * strlen(s) + 1)) == NULL) + gripe_alloc(sizeof(char) * strlen(s) + 1, "lang_path"); + strcpy(path, s); + convert_path(p->path, path, ":", MAX_SUPPORT_LANG_DIRS); + } else { + if (!exist) { + free(p->directive); + free(p->path); + free(p); + *q = NULL; + return NULL; + } + } + + d_dst = p->directive; + d_src = default_lang_env->directive; + for (d_name = directive_list; *d_name; d_name++, d_dst++, d_src++) { + snprintf(buf, sizeof(buf), ENV_PREFIX "_%s_%s", lang_upper, *d_name); + if ((s = getenv(buf)) != NULL) { + *d_dst = s; + insecure = 1; + } else { + if (!exist) + *d_dst = *d_src; + } + } + + return p; +} + + +man_lang_env_t ***make_search_list() +{ + man_lang_env_t **p, ***q, ***root; + char **s, **t, *e; + char *list_1[MAX_SUPPORT_LANG], *list_2[MAX_SUPPORT_LANG_DIRS]; + int i; + char *list[MAX_SUPPORT_LANG + 1]; + static char buf[BUFSIZ]; + + if ((e = getenv(ENV_PREFIX "_SEARCH")) != NULL) + search_lang_path = e; + strcpy(buf, search_lang_path); + convert_path(list_1, buf, "%", MAX_SUPPORT_LANG); + for (i = 0; list_1[i]; i++); /* count length of list_1*/ + if ((root = + (man_lang_env_t ***)malloc(sizeof(man_lang_env_t ***) * i + 1)) == NULL) + gripe_alloc(sizeof(man_lang_env_t ***) * i + 1, "lang_search_list"); + + q = root; + for (s = list_1; *s; s++) { + convert_path(list_2, *s, ":", MAX_SUPPORT_LANG_DIRS); + for (i = 0; list_2[i]; i++); + if ((p = *q = + (man_lang_env_t **)malloc(sizeof(man_lang_env_t **) * i + 1)) == NULL) + gripe_alloc(sizeof(man_lang_env_t **), "lang_search_list"); + for (t = list_2; *t; t++) { + *p = new_lang_env(*t); + if (*p) + p++; + } + *p = NULL; + q++; + } + *q = NULL; + + if (debug) { + for (p = lang_env_list; *p; p++) { + fprintf(stderr, "\nlanguage environment \"%s\" (%0x)\n", + (*p)->name, *p); + + fprintf(stderr, " search directory list: "); + for (s = (*p)->path; *s; s++) + fprintf(stderr, " \"%s\",", *s); + fprintf(stderr, " (null)\n"); + + for (i = 0; i < N_DIRECTIVE; i++) + fprintf(stderr, " %-8s: \"%s\"\n", directive_list[i], + (*p)->directive[i]); + } + } + + return root; +} + +char *directive(int n) +{ + return (current_locale_set->directive[n]); +} + +int try_section_ml(char *path, char *section, char *name, + int glob, int findall) +{ + man_lang_env_t **p; + char **d, buf[BUFSIZ]; + int found = 0; + + for (p = current_locale_list_root; *p; p++) { + current_locale_set = *p; /* current_locale_set is global */ + for (d = current_locale_set->path; *d; d++) { + if (debug) + fprintf(stderr, "trying subdir \"%s\"\n", *d); + if (**d != '\0') + snprintf(buf, sizeof(buf), "%s/%s", path, *d); + else + snprintf(buf, sizeof(buf), "%s", path); + found += try_section(buf, section, name, glob); + if (found && !findall) + return found; + } + } + return found; +} + +int man_ml(char *name) +{ + static man_lang_env_t ***root = NULL; + man_lang_env_t ***p; + int found = 0; + + if (root == NULL) + root = make_search_list(); + + for (p = root; *p; p++) { + current_locale_list_root = *p; /* current_locale_list_root is global */ + found += man(name); + if (found && !findall) + return found; + } + return found; +} Index: man/man/locale.h diff -u /dev/null man/man/locale.h:1.1 --- /dev/null Mon Aug 27 09:02:06 2001 +++ man/man/locale.h Tue Jul 17 10:42:54 2001 @@ -0,0 +1,24 @@ +/* $Id: locale.h,v 1.1 2001/07/17 01:42:54 mori Exp $ */ + +#define N_DIRECTIVE 11 +#define N_TROFF 0 +#define N_NROFF 1 +#define N_EQN 2 +#define N_NEQN 3 +#define N_GRAP 4 +#define N_PIC 5 +#define N_TBL 6 +#define N_VGRIND 7 +#define N_REFER 8 +#define N_COL 9 +#define N_PAGER 10 + +extern int insecure; +extern int debug; +extern char *search_lang_path; + +char *directive(int); +int try_section_ml(char *, char *, char *, int, int); +int try_section(char *, char *, char *, int); +int man_ml(char *); +int man(char *); Index: man/man/man.c diff -u man/man/man.c:1.1.1.1 man/man/man.c:1.5 --- man/man/man.c:1.1.1.1 Tue Jul 17 10:34:21 2001 +++ man/man/man.c Mon Jul 30 17:49:20 2001 @@ -37,6 +37,7 @@ #include "config.h" #include "gripes.h" #include "version.h" +#include "locale.h" #ifdef POSIX #include @@ -87,9 +88,6 @@ static int whatis; static int findall; static int print_where; -#ifdef LOCALE -static int force_original; -#endif #ifdef ALT_SYSTEMS static int alt_system; @@ -99,17 +97,19 @@ static int troff = 0; int debug; +int insecure; +int ignore_cat_file; #ifdef HAS_TROFF #ifdef ALT_SYSTEMS #ifdef LOCALE -static char args[] = "M:P:S:adfhkm:op:tw?"; +static char args[] = "M:P:S:adfhikm:op:tw?"; #else static char args[] = "M:P:S:adfhkm:p:tw?"; #endif #else #ifdef LOCALE -static char args[] = "M:P:S:adfhkop:tw?"; +static char args[] = "M:P:S:adfhikop:tw?"; #else static char args[] = "M:P:S:adfhkp:tw?"; #endif @@ -117,13 +117,13 @@ #else #ifdef ALT_SYSTEMS #ifdef LOCALE -static char args[] = "M:P:S:adfhkm:op:w?"; +static char args[] = "M:P:S:adfhikm:op:w?"; #else static char args[] = "M:P:S:adfhkm:p:w?"; #endif #else #ifdef LOCALE -static char args[] = "M:P:S:adfhkop:w?"; +static char args[] = "M:P:S:adfhikop:w?"; #else static char args[] = "M:P:S:adfhkp:w?"; #endif @@ -222,7 +222,7 @@ } else { - status = man (nextarg); + status = man_ml (nextarg); if (status == 0) gripe_not_found (nextarg, section); @@ -334,46 +334,20 @@ } char ** -#ifdef LOCALE -add_dir_to_mpath_list (mp, pp, locale) -#else add_dir_to_mpath_list (mp, p) -#endif char **mp; -#ifdef LOCALE - char *pp; - int locale; -#else char *p; -#endif { int status; -#ifdef LOCALE - char *p; - char *tmp_locale; - int num_expand = 1; - - if (locale && (tmp_locale = strdup(current_locale)) != NULL) - { - if (tmp_locale[2] == '_') - num_expand++; - if (tmp_locale[5] == '.') - num_expand++; - } + char q[MAXPATHLEN+1]; - while (num_expand > 0) { - if (locale) - { - static char buf[FILENAME_MAX]; - - snprintf(buf, (size_t)(FILENAME_MAX - 1), "%s/%s", pp, tmp_locale); - p = buf; - } - else - { - p = pp; - } -#endif + if (p && *p != '/') { + insecure++; + getcwd(q, sizeof(q) - 1); + strcat(q, "/"); + strncat(q, p, sizeof(q) - strlen(q) - 1); + p = q; + } status = is_directory (p); @@ -392,21 +366,6 @@ *mp++ = strdup (p); } -#ifdef LOCALE - num_expand--; - if (locale) - { - if (num_expand > 1) - { - tmp_locale[5] = '\0'; - } - else if (num_expand > 0) - { - tmp_locale[2] = '\0'; - } - } - } -#endif return mp; } @@ -422,9 +381,6 @@ register char *p; register char *end; register char **mp; -#ifdef LOCALE - register int locale; -#endif extern void downcase (); extern char *manpath (); @@ -458,6 +414,11 @@ gripe_incompatible ("-f and -w"); whatis++; break; +#ifdef LOCALE + case 'i': + ignore_cat_file++; + break; +#endif case 'k': if (troff) gripe_incompatible ("-k and -t"); @@ -475,7 +436,7 @@ #endif #ifdef LOCALE case 'o': - force_original++; + search_lang_path = "en"; break; #endif case 'p': @@ -510,11 +471,13 @@ } if (pager == NULL || *pager == '\0') - if ((pager = getenv ("PAGER")) == NULL) - pager = strdup (PAGER); + pager = getenv ("PAGER"); if (debug) - fprintf (stderr, "\nusing %s as pager\n", pager); + if (pager) + fprintf (stderr, "\nusing %s as pager\n", pager); + else + fprintf (stderr, "\nusing default pager\n"); if ((machine = getenv ("MACHINE")) == NULL) machine = MACHINE; @@ -546,12 +509,6 @@ * Expand the manpath into a list for easier handling. */ mp = manpathlist; -#ifdef LOCALE - for (locale = 1; locale >= 0; locale--) - { - if (locale && (force_original || !current_locale || *current_locale == '\0')) - continue; -#endif for (p = manp; ; p = end+1) { if (mp == manpathlist + MAXDIRS - 1) { @@ -572,35 +529,20 @@ snprintf(buf, sizeof(buf), "%s/%s", p, alt_system_name); -# ifdef LOCALE - mp = add_dir_to_mpath_list (mp, buf, locale); -# else mp = add_dir_to_mpath_list (mp, buf); -# endif } else { -# ifdef LOCALE - mp = add_dir_to_mpath_list (mp, p, locale); -# else mp = add_dir_to_mpath_list (mp, p); -# endif } #else -# ifdef LOCALE - mp = add_dir_to_mpath_list (mp, p, locale); -# else mp = add_dir_to_mpath_list (mp, p); -# endif #endif if (end == NULL) break; *end = ':'; } -#ifdef LOCALE - } -#endif *mp = NULL; } @@ -879,9 +821,11 @@ char *expander = get_expander (file); if (expander != NULL) - snprintf (command, sizeof(command), "%s %s | %s", expander, file, pager); + snprintf (command, sizeof(command), "%s %s | %s", expander, file, + pager ? pager : directive(N_PAGER)); else - snprintf (command, sizeof(command), "%s %s", pager, file); + snprintf (command, sizeof(command), "%s %s", + pager ? pager : directive(N_PAGER), file); found = do_system_command (command); } @@ -992,9 +936,9 @@ fprintf (stderr, "found eqn(1) directive\n"); if (troff) - add_directive (&first, EQN, file, buf, bufsize); + add_directive (&first, directive(N_EQN), file, buf, bufsize); else - add_directive (&first, NEQN, file, buf, bufsize); + add_directive (&first, directive(N_NEQN), file, buf, bufsize); break; @@ -1003,7 +947,7 @@ if (debug) fprintf (stderr, "found grap(1) directive\n"); - add_directive (&first, GRAP, file, buf, bufsize); + add_directive (&first, directive(N_GRAP), file, buf, bufsize); break; @@ -1012,7 +956,7 @@ if (debug) fprintf (stderr, "found pic(1) directive\n"); - add_directive (&first, PIC, file, buf, bufsize); + add_directive (&first, directive(N_PIC), file, buf, bufsize); break; @@ -1022,7 +966,7 @@ fprintf (stderr, "found tbl(1) directive\n"); tbl_found++; - add_directive (&first, TBL, file, buf, bufsize); + add_directive (&first, directive(N_TBL), file, buf, bufsize); break; case 'v': @@ -1030,7 +974,7 @@ if (debug) fprintf (stderr, "found vgrind(1) directive\n"); - add_directive (&first, VGRIND, file, buf, bufsize); + add_directive (&first, directive(N_VGRIND), file, buf, bufsize); break; case 'r': @@ -1038,7 +982,7 @@ if (debug) fprintf (stderr, "found refer(1) directive\n"); - add_directive (&first, REFER, file, buf, bufsize); + add_directive (&first, directive(N_REFER), file, buf, bufsize); break; case ' ': @@ -1062,18 +1006,18 @@ if (troff) { strncat (buf, " | ", bufsize-strlen(buf)-1); - strncat (buf, TROFF, bufsize-strlen(buf)-1); + strncat (buf, directive(N_TROFF), bufsize-strlen(buf)-1); } else #endif { strncat (buf, " | ", bufsize-strlen(buf)-1); - strncat (buf, NROFF, bufsize-strlen(buf)-1); + strncat (buf, directive(N_NROFF), bufsize-strlen(buf)-1); } - if (tbl_found && !troff && strcmp (COL, "") != 0) + if (tbl_found && !troff && strcmp (directive(N_COL), "") != 0) { strncat (buf, " | ", bufsize-strlen(buf)-1); - strncat (buf, COL, bufsize-strlen(buf)-1); + strncat (buf, directive(N_COL), bufsize-strlen(buf)-1); } return 0; @@ -1155,35 +1099,35 @@ #ifdef HAS_TROFF if (troff) { - if (strcmp (TBL, "") != 0) + if (strcmp (directive(N_TBL), "") != 0) { - strncat(buf, TBL, sizeof(buf)-strlen(buf)-1); + strncat(buf, directive(N_TBL), sizeof(buf)-strlen(buf)-1); strncat(buf, " | ", sizeof(buf)-strlen(buf)-1); - strncat(buf, TROFF, sizeof(buf)-strlen(buf)-1); + strncat(buf, directive(N_TROFF), sizeof(buf)-strlen(buf)-1); } else { - strncat(buf, TROFF, sizeof(buf)-strlen(buf)-1); + strncat(buf, directive(N_TROFF), sizeof(buf)-strlen(buf)-1); } } else #endif { - if (strcmp (TBL, "") != 0) + if (strcmp (directive(N_TBL), "") != 0) { - strncat(buf, TBL, sizeof(buf)-strlen(buf)-1); + strncat(buf, directive(N_TBL), sizeof(buf)-strlen(buf)-1); strncat(buf, " | ", sizeof(buf)-strlen(buf)-1); - strncat(buf, NROFF, sizeof(buf)-strlen(buf)-1); + strncat(buf, directive(N_NROFF), sizeof(buf)-strlen(buf)-1); } else { - strncpy (buf, NROFF, sizeof(buf)); + strncpy (buf, directive(N_NROFF), sizeof(buf)); } - if (strcmp (COL, "") != 0) + if (strcmp (directive(N_COL), "") != 0) { strncat (buf, " | ", sizeof(buf)-strlen(buf)-1); - strncat (buf, COL, sizeof(buf)-strlen(buf)-1); + strncat (buf, directive(N_COL), sizeof(buf)-strlen(buf)-1); } } return buf; @@ -1414,7 +1358,7 @@ if (debug) fprintf (stderr, "status from is_newer() = %d\n", status); - if (status == 1 || status == -2) + if (status == 1 || status == -2 || ignore_cat_file) { /* * Cat file is out of date. Try to format and save it. @@ -1424,9 +1368,10 @@ printf ("%s\n", man_file); found++; } - else + else if (!insecure) { - + if (debug) + fprintf(stderr, "secure mode\n"); #ifdef SETREUID setreuid(-1, euid); setregid(-1, egid); @@ -1485,11 +1430,23 @@ return 0; else snprintf (command, sizeof(command), "(cd %s ; %s | %s)", path, - roff_command, pager); + roff_command, pager ? pager : directive(N_PAGER)); found = do_system_command (command); } } + else + { + if (debug) + fprintf (stderr, "insecure mode\n"); + roff_command = make_roff_command (man_file); + if (roff_command == NULL) + return 0; + else + snprintf (command, sizeof(command), "(cd %s ; %s | %s)", path, + roff_command, pager ? pager : directive(N_PAGER)); + found = do_system_command (command); + } } else if (access (cat_file, R_OK) == 0) { @@ -1643,6 +1600,7 @@ register int glob; register char **mp; register char **sp; + char buf[BUFSIZ], **path; found = 0; @@ -1656,9 +1614,9 @@ glob = 1; - found += try_section (*mp, section, name, glob); + found += try_section_ml (*mp, section, name, glob, findall); - if (found && !findall) /* i.e. only do this section... */ + if (found && !findall) /* i.e. only do this section... */ return found; } } @@ -1673,7 +1631,7 @@ glob = 1; - found += try_section (*mp, *sp, name, glob); + found += try_section_ml (*mp, *sp, name, glob, findall); if (found && !findall) /* i.e. only do this section... */ return found;