465 |
/* Main procedure */ |
/* Main procedure */ |
466 |
/*----------------------------------------------------------------------*/ |
/*----------------------------------------------------------------------*/ |
467 |
/* |
/* |
|
* Encode URL. |
|
|
* |
|
|
* i) url URL |
|
|
* r) encoded URL |
|
|
*/ |
|
|
static const char * |
|
|
encode(const char *url) |
|
|
{ |
|
|
STATIC_STRBUF(sb); |
|
|
const char *p; |
|
|
|
|
|
strbuf_clear(sb); |
|
|
for (p = url; *p; p++) { |
|
|
int c = (unsigned char)*p; |
|
|
|
|
|
if (isalnum(c)) |
|
|
strbuf_putc(sb, c); |
|
|
else |
|
|
strbuf_sprintf(sb, "%%%02x", c); |
|
|
} |
|
|
|
|
|
return strbuf_value(sb); |
|
|
} |
|
|
/* |
|
468 |
* extract_lastname: extract the last name of include line. |
* extract_lastname: extract the last name of include line. |
469 |
* |
* |
470 |
* i) image source image of include |
* i) image source image of include |
753 |
strbuf_reset(sb); |
strbuf_reset(sb); |
754 |
if (!no_order_list) |
if (!no_order_list) |
755 |
strbuf_puts(sb, item_begin); |
strbuf_puts(sb, item_begin); |
756 |
|
strbuf_puts(sb, gen_href_begin_with_title_target(count_stack(dirstack) ? upperdir(SRCS) : SRCS, path2fid(_), HTML, NULL, _, target)); |
|
{ |
|
|
char tmp[1024]; |
|
|
const char *file, *suffix = NULL, *dir = NULL; |
|
|
|
|
|
if (gp->type == GPATH_OTHER && dynamic) { |
|
|
if (!(*action == '/' || count_stack(dirstack) == 0)) |
|
|
dir = ".."; |
|
|
snprintf(tmp, sizeof(tmp), "%s?pattern=%s%stype=source", |
|
|
action, encode(_), quote_amp); |
|
|
file = tmp; |
|
|
} else { |
|
|
dir = count_stack(dirstack) ? upperdir(SRCS) : SRCS; |
|
|
file = path2fid(_); |
|
|
suffix = HTML; |
|
|
} |
|
|
strbuf_puts(sb, gen_href_begin_with_title_target(dir, file, suffix, NULL, _, target)); |
|
|
} |
|
757 |
if (icon_list) { |
if (icon_list) { |
758 |
const char *lang, *suffix, *text_icon; |
const char *lang, *suffix, *text_icon; |
759 |
|
|