=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/tags.c,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.4 diff -c -r1.1.1.3 -r1.1.1.4 *** src/usr.bin/less/tags.c 2011/09/16 17:47:08 1.1.1.3 --- src/usr.bin/less/tags.c 2014/04/25 13:33:52 1.1.1.4 *************** *** 1,11 **** /* ! * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * ! * For more information about less, or for information on how to ! * contact the author, see the README file. */ --- 1,10 ---- /* ! * Copyright (C) 1984-2012 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. * ! * For more information, see the README file. */ *************** *** 21,27 **** static int curseq; extern int linenums; ! extern int sigs; enum tag_result { TAG_FOUND, --- 20,26 ---- static int curseq; extern int linenums; ! extern volatile sig_atomic_t sigs; enum tag_result { TAG_FOUND, *************** *** 120,136 **** register struct tag *tp; tp = (struct tag *) ecalloc(sizeof(struct tag), 1); ! tp->tag_file = (char *) ecalloc(strlen(file) + 1, sizeof(char)); ! strcpy(tp->tag_file, file); tp->tag_linenum = linenum; tp->tag_endline = endline; if (pattern == NULL) tp->tag_pattern = NULL; else ! { ! tp->tag_pattern = (char *) ecalloc(strlen(pattern) + 1, sizeof(char)); ! strcpy(tp->tag_pattern, pattern); ! } return (tp); } --- 119,131 ---- register struct tag *tp; tp = (struct tag *) ecalloc(sizeof(struct tag), 1); ! tp->tag_file = save(file); tp->tag_linenum = linenum; tp->tag_endline = endline; if (pattern == NULL) tp->tag_pattern = NULL; else ! tp->tag_pattern = save(pattern); return (tp); } *************** *** 477,482 **** --- 472,478 ---- char buf[256]; FILE *fp; struct tag *tp; + size_t len; if (type != T_CTAGS_X && tag == NULL) return TAG_NOFILE; *************** *** 528,536 **** qtag = shell_quote(tag); if (qtag == NULL) qtag = tag; ! command = (char *) ecalloc(strlen(cmd) + strlen(flag) + ! strlen(qtag) + 5, sizeof(char)); ! sprintf(command, "%s -x%s %s", cmd, flag, qtag); if (qtag != tag) free(qtag); fp = popen(command, "r"); --- 524,532 ---- qtag = shell_quote(tag); if (qtag == NULL) qtag = tag; ! len = strlen(cmd) + strlen(flag) + strlen(qtag) + 5; ! command = (char *) ecalloc(len, sizeof(char)); ! snprintf(command, len, "%s -x%s %s", cmd, flag, qtag); if (qtag != tag) free(qtag); fp = popen(command, "r"); *************** *** 542,548 **** while (fgets(buf, sizeof(buf), fp)) { char *name, *file, *line; - int len; if (sigs) { --- 538,543 ----