Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 May 1996 08:14:45 +0900
From:      Shigio Yamaguchi <shigio@ca2.so-net.or.jp>
To:        hackers@freebsd.org
Cc:        shigio@ca2.so-net.or.jp
Subject:   ctags second patch for global
Message-ID:  <199605022314.IAA00473@chiota>

next in thread | raw e-mail | index | archive | help

Hello this is Yamaguchi.
I have made second patch for ctags.

Following kit include a ctags2.diff

Thank you.
............................................................


This is the first BUGFIX patch for GLOBAL version1.0.
This patch makes global version1.1.

Contents are followings.

	README-1.1		read me first
	global-1.1.diff		patch file

Fixed bugs

   global        - makes corrupted path name by conversion error.
		 - description of exit code in global.1 is mistaken.
   btreeop	 - cannot treat a long line over BUFSIZ. With the result
		   that gtags fails.
   patched ctags - when using -r option, considers a reserved word to be
		   a function name. With the result that GRTAGS becomes
		   too large.

You had better remake database, because GRTAGS has many unnecessary data.

Thank you for your cooperation.
------------------ C U T     H E R E ------------------------
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	README-1.1
#	global-1.1.diff
#
echo x - README-1.1
sed 's/^X//' >README-1.1 << 'END-of-README-1.1'
X
XThis is the first bugfix patch for global 1.0.
XThis patch makes global version1.1.
X
X           #######
X	 #        #
X	#             #     #####  ######      ##   #
X	#    B  U  G  F  I  X  1 #  #   #  version 1.1
X	#      ###### #    #     #  #####    ####   #
X	 #        #   #    #     #  #    # #    #   #
X	  ########    ####  #####  ###### ###  ####  ######
X
X		For FreeBSD2.1 or 2.0.5
X		Copyright  Shigio Yamaguchi <shigio@ca2.so-net.or.jp>
X
X						5/2/96
X
Xo History
X
X   Contents           Version            README-Date
X   ===========================================================
X   1. Initial post    1.0                04/21/96
X   2. First bugfix    1.1                05/02/96	<= This article
X
Xo Fixed bugs
X
X   global        - makes corrupted path name by conversion error.
X		 - description of exit code in global.1 is mistaken.
X   btreeop	 - cannot treat a long line over BUFSIZ. With the result
X		   that gtags fails.
X   patched ctags - when using -r option, considers a reserved word to be
X		   a function name. With the result that GRTAGS becomes
X		   too large.
X
X   You had better remake database, because GRTAGS has many unnecessary data.
X
Xo How to patch
X
X   Assume global version1.0 has been extracted.
X
X   a) global and btreeop
X
X	% cd global-1.0			<- this is global 1.0 directory
X	% patch -p < global-1.1.diff	<- THIS PATCH
X	% make
X	# make install
X
X   b) patched ctags
X
X	% set d=`pwd`			<- this is global 1.0 directory
X	% cd /usr/src/usr.bin/ctags
X
X	If you have not installed global 1.0, that is, ctags is still
X	a original one, please apply both 'ctags.diff' and 'ctags2.diff'.
X
X	% patch < $d/ctags.diff
X	% patch < $d/ctags2.diff
X
X	Otherwise, only 'ctags2.diff' is needed.
X
X	% patch < $d/ctags2.diff
X
X	% make
X	# make install
X
XThank you for your cooperation.
END-of-README-1.1
echo x - global-1.1.diff
sed 's/^X//' >global-1.1.diff << 'END-of-global-1.1.diff'
Xdiff -c -r -N ../global-1.0/VERSION ./VERSION
X*** ../global-1.0/VERSION	Thu Jan  1 09:00:00 1970
X--- ./VERSION	Thu May  2 23:16:57 1996
X***************
X*** 0 ****
X--- 1 ----
X+ 1.1
Xdiff -c -r -N ../global-1.0/btreeop/btreeop.c ./btreeop/btreeop.c
X*** ../global-1.0/btreeop/btreeop.c	Mon Apr 22 21:31:30 1996
X--- ./btreeop/btreeop.c	Wed May  1 18:34:59 1996
X***************
X*** 28,34 ****
X   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X   * SUCH DAMAGE.
X   *
X!  *	btreeop.c	version1.0		4/21/96
X   *
X   */
X  #include <stdio.h>
X--- 28,34 ----
X   * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X   * SUCH DAMAGE.
X   *
X!  *	btreeop.c	version1.1		5/1/96
X   *
X   */
X  #include <stdio.h>
X***************
X*** 188,194 ****
X  	 * - Null Data not allowed.
X  	 */
X  	while (fgets(buf, BUFSIZ, stdin)) {
X! 		buf[strlen(buf)-1] = 0;			/* chop(buf) */
X  		for (c = buf; *c && !isspace(*c); c++)	/* skip key part */
X  			;
X  		if (*c == 0)
X--- 188,198 ----
X  	 * - Null Data not allowed.
X  	 */
X  	while (fgets(buf, BUFSIZ, stdin)) {
X! 		if (buf[strlen(buf)-1] == '\n')		/* chop(buf) */
X! 			buf[strlen(buf)-1] = 0;
X! 		else
X! 			while (fgetc(stdin) != '\n')
X! 				;
X  		for (c = buf; *c && !isspace(*c); c++)	/* skip key part */
X  			;
X  		if (*c == 0)
Xdiff -c -r -N ../global-1.0/ctags2.diff ./ctags2.diff
X*** ../global-1.0/ctags2.diff	Thu Jan  1 09:00:00 1970
X--- ./ctags2.diff	Thu May  2 20:34:18 1996
X***************
X*** 0 ****
X--- 1,109 ----
X+ diff -c /usr/src/usr.bin/ctags/C.c ./C.c
X+ *** /usr/src/usr.bin/ctags/C.c	Wed May  1 22:43:54 1996
X+ --- ./C.c	Wed May  1 22:31:28 1996
X+ ***************
X+ *** 439,444 ****
X+ --- 439,494 ----
X+   }
X+   
X+   #ifdef GTAGS
X+ + 		/* sorted by alphabet */
X+ + char	*statement_word[] = {
X+ + 	"auto",
X+ + 	"break",
X+ + 	"case",
X+ + 	"char",
X+ + 	"continue",
X+ + 	"default",
X+ + 	"do",
X+ + 	"double",
X+ + 	"else",
X+ + 	"entry",
X+ + 	"extern",
X+ + 	"float",
X+ + 	"for",
X+ + 	"goto",
X+ + 	"if",
X+ + 	"int",
X+ + 	"long",
X+ + 	"register",
X+ + 	"return",
X+ + 	"short",
X+ + 	"sizeof",
X+ + 	"static",
X+ + 	"struct",
X+ + 	"switch",
X+ + 	"typedef",
X+ + 	"union",
X+ + 	"unsigned",
X+ + 	"void",
X+ + 	"while",
X+ + };
X+ + int	last = sizeof(statement_word)/sizeof(char *);
X+ + 
X+ + int
X+ + isstatement(token)
X+ +         char *token;
X+ + {
X+ +         int     i;
X+ +         for (i = 0; i < last; i++) {
X+ +                 if (*statement_word[i] > *token)
X+ +                 	break;
X+ +                 if (*statement_word[i] < *token)
X+ +                         continue;
X+ +                 if (!strcmp(statement_word[i], token))
X+ +                         return YES;
X+ +         }
X+ +         return NO;
X+ + }
X+ + 
X+   define_line()
X+   {
X+   	int	c;			/* character read */
X+ diff -c /usr/src/usr.bin/ctags/ctags.c ./ctags.c
X+ *** /usr/src/usr.bin/ctags/ctags.c	Wed May  1 22:43:55 1996
X+ --- ./ctags.c	Wed May  1 21:09:47 1996
X+ ***************
X+ *** 322,362 ****
X+   }
X+   
X+   #ifdef GTAGS
X+ - 		/* sorted by alphabet */
X+ - char	*statement_words[] = {
X+ - 	"char",
X+ - 	"double",
X+ - 	"float",
X+ - 	"for",
X+ - 	"if",
X+ - 	"int",
X+ - 	"long",
X+ - 	"return",
X+ - 	"short",
X+ - 	"sizeof",
X+ - 	"switch",
X+ - 	"unsigned",
X+ - 	"while",
X+ - };
X+ - int	last = sizeof(statement_words)/sizeof(char *);
X+ - 
X+ - int
X+ - isstatement(token)
X+ -         char *token;
X+ - {
X+ -         int     i;
X+ - 
X+ -         for (i = 0; i < last; i++) {
X+ -                 if (*statement_words[i] < *token)
X+ -                 	break;
X+ -                 if (*statement_words[i] > *token)
X+ -                         continue;
X+ -                 if (!strcmp(statement_words[i], token))
X+ -                         return YES;
X+ -         }
X+ -         return NO;
X+ - }
X+ - 
X+   #include <db.h>
X+   #include <fcntl.h>
X+   DB      *db;
X+ --- 322,327 ----
Xdiff -c -r -N ../global-1.0/global/global.1 ./global/global.1
X*** ../global-1.0/global/global.1	Tue Apr 23 22:51:48 1996
X--- ./global/global.1	Thu May  2 22:11:28 1996
X***************
X*** 104,110 ****
X  
X  .Sh DIAGNOSTICS
X  .Nm Global
X! exits with a value of 1 if an error occurred, 0 otherwise.
X  .Sh SEE ALSO
X  .Xr gtags 1 ,
X  .Xr btreeop 1
X--- 104,110 ----
X  
X  .Sh DIAGNOSTICS
X  .Nm Global
X! exits with a non 0 value if an error occurred, 0 otherwise.
X  .Sh SEE ALSO
X  .Xr gtags 1 ,
X  .Xr btreeop 1
Xdiff -c -r -N ../global-1.0/global/global.pl ./global/global.pl
X*** ../global-1.0/global/global.pl	Mon Apr 22 21:31:45 1996
X--- ./global/global.pl	Thu May  2 22:07:48 1996
X***************
X*** 29,35 ****
X  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X  # SUCH DAMAGE.
X  #
X! #	global.pl	version1.0	4/21/96
X  #
X  sub getcwd {
X  	local($dir);
X--- 29,35 ----
X  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X  # SUCH DAMAGE.
X  #
X! #	global.pl	version1.1	5/2/96
X  #
X  sub getcwd {
X  	local($dir);
X***************
X*** 89,98 ****
X  $cur =~ s!$root!!;
X  $cur =~ s!^/!!;
X  @step = split('/', $cur);
X! $downpath = '../' x @step;
X! push(@subcom, "-e 's!\./!$downpath!'");
X  foreach $step (@step) {
X! 	push(@subcom, "-e 's!\.\./$step/!!'");
X  }
X  #
X  # setup pipeline
X--- 89,98 ----
X  $cur =~ s!$root!!;
X  $cur =~ s!^/!!;
X  @step = split('/', $cur);
X! $downpath = '\\.\\./' x @step;
X! push(@subcom, "-e 's!\\./!$downpath!'");
X  foreach $step (@step) {
X! 	push(@subcom, "-e 's!\\.\\./$step/!!'");
X  }
X  #
X  # setup pipeline
END-of-global-1.1.diff
exit
------------------ C U T     H E R E ------------------------
--
Shigio Yamaguchi	E-Mail: shigio@ca2.so-net.or.jp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605022314.IAA00473>