421 |
FILE *ip; |
FILE *ip; |
422 |
STRBUF *sb = strbuf_open(0); |
STRBUF *sb = strbuf_open(0); |
423 |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
STRBUF *ib = strbuf_open(MAXBUFLEN); |
|
STRBUF *sort_command = strbuf_open(0); |
|
424 |
char *fid; |
char *fid; |
425 |
|
|
426 |
/* |
/* |
|
* get command name of sort. |
|
|
*/ |
|
|
if (!getconfs("sort_command", sort_command)) |
|
|
die("cannot get sort command name."); |
|
|
#if defined(_WIN32) || defined(__DJGPP__) |
|
|
if (!locatestring(strbuf_value(sort_command), ".exe", MATCH_LAST)) |
|
|
strbuf_puts(sort_command, ".exe"); |
|
|
#endif |
|
|
/* |
|
427 |
* add path index if not yet. |
* add path index if not yet. |
428 |
*/ |
*/ |
429 |
gpath_put(path); |
gpath_put(path); |
447 |
strbuf_putc(sb, ' '); |
strbuf_putc(sb, ' '); |
448 |
strbuf_puts(sb, fid); |
strbuf_puts(sb, fid); |
449 |
} |
} |
450 |
if (gtop->format & GTAGS_COMPACT) { |
if (gtop->format & GTAGS_COMPACT) |
451 |
strbuf_puts(sb, "| "); |
strbuf_puts(sb, "| gnusort -k 1,1 -k 2,2n"); |
|
strbuf_puts(sb, strbuf_value(sort_command)); |
|
|
strbuf_putc(sb, ' '); |
|
|
strbuf_puts(sb, "-k 1,1 -k 2,2n"); |
|
|
} |
|
452 |
if (flags & GTAGS_UNIQUE) |
if (flags & GTAGS_UNIQUE) |
453 |
strbuf_puts(sb, " -u"); |
strbuf_puts(sb, " -u"); |
454 |
#ifdef DEBUG |
#ifdef DEBUG |
486 |
} |
} |
487 |
if (pclose(ip) < 0) |
if (pclose(ip) < 0) |
488 |
die("terminated abnormally."); |
die("terminated abnormally."); |
|
strbuf_close(sort_command); |
|
489 |
strbuf_close(sb); |
strbuf_close(sb); |
490 |
strbuf_close(ib); |
strbuf_close(ib); |
491 |
} |
} |