[Commit] jove ChangeLog, 1.3, 1.4 abbrev.c, 1.3, 1.4 ask.c, 1.5, 1.6 buf.c, 1.4, 1.5 c.c, 1.6, 1.7 extend.c, 1.3, 1.4 funcdefs.c, 1.2, 1.3 insert.c, 1.6, 1.7 io.c, 1.4, 1.5 iproc-ptys.c, 1.5, 1.6 iproc.c, 1.5, 1.6 jove.h, 1.9, 1.10 man.c, 1.4, 1.5 paragraph.c, 1.4, 1.5 re.c, 1.5, 1.6 re1.c, 1.4, 1.5 screen.c, 1.6, 1.7 tune.h, 1.4, 1.5 util.c, 1.4, 1.5

Keith Packard commit at keithp.com
Tue Oct 19 22:26:43 PDT 2004


Committed by: keithp

Update of /local/src/CVS/jove
In directory home.keithp.com:/tmp/cvs-serv32161

Modified Files:
	ChangeLog abbrev.c ask.c buf.c c.c extend.c funcdefs.c 
	insert.c io.c iproc-ptys.c iproc.c jove.h man.c paragraph.c 
	re.c re1.c screen.c tune.h util.c 
Log Message:
2004-10-19  Keith Packard  <keithp at keithp.com>

	* abbrev.c:
	* ask.c:
	* buf.c: (strchr_ucs4), (strrchr_ucs4):
	* c.c: (FindMatch):
	* doc/.joverc:
	* extend.c: (addgetc):
	* funcdefs.c:
	* insert.c: (DescribeCompose):
	* io.c: (WriteFile):
	* iproc-ptys.c:
	* iproc.c: (ProcCDToRealBufferDir):
	* jove.h:
	* man.c: (scanapropos):
	* paragraph.c: (do_space):
	* re.c: (do_comp):
	* re1.c:
	* screen.c: (Placur):
	* tune.h:
	* util.c:
	Replace usage of index/rindex with strchr_ucs4/strrchr_ucs4
	which handle UTF-8 encoded strings and single UCS4 encoded chars.
	Don't use tabs for positioning when in utf-8 output mode because
	double-width characters make this hard.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/jove/ChangeLog,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ChangeLog	18 Oct 2004 04:31:16 -0000	1.3
+++ ChangeLog	20 Oct 2004 05:26:40 -0000	1.4
@@ -1,3 +1,29 @@
+2004-10-19  Keith Packard  <keithp at keithp.com>
+
+	* abbrev.c:
+	* ask.c:
+	* buf.c: (strchr_ucs4), (strrchr_ucs4):
+	* c.c: (FindMatch):
+	* doc/.joverc:
+	* extend.c: (addgetc):
+	* funcdefs.c:
+	* insert.c: (DescribeCompose):
+	* io.c: (WriteFile):
+	* iproc-ptys.c:
+	* iproc.c: (ProcCDToRealBufferDir):
+	* jove.h:
+	* man.c: (scanapropos):
+	* paragraph.c: (do_space):
+	* re.c: (do_comp):
+	* re1.c:
+	* screen.c: (Placur):
+	* tune.h:
+	* util.c:
+	Replace usage of index/rindex with strchr_ucs4/strrchr_ucs4
+	which handle UTF-8 encoded strings and single UCS4 encoded chars.
+	Don't use tabs for positioning when in utf-8 output mode because
+	double-width characters make this hard.
+
 2004-10-17  Keith Packard  <keithp at keithp.com>
 
 	* jove.c: (dispatch):

Index: abbrev.c
===================================================================
RCS file: /local/src/CVS/jove/abbrev.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- abbrev.c	15 May 2003 00:01:06 -0000	1.3
+++ abbrev.c	20 Oct 2004 05:26:40 -0000	1.4
@@ -199,7 +199,7 @@
 		}
 		if (mode == -1)
 fmterr:			complain("Abbrev. format error, line %d.", file, lnum);
-		phrase_p = index(genbuf, ':');
+		phrase_p = strchr_ucs4(genbuf, ':');
 		if (phrase_p == 0)
 			goto fmterr;
 		*phrase_p++ = '\0';	/* Null terminate the abbrev. */

Index: ask.c
===================================================================
RCS file: /local/src/CVS/jove/ask.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ask.c	10 Jun 2003 17:32:07 -0000	1.5
+++ ask.c	20 Oct 2004 05:26:40 -0000	1.6
@@ -158,7 +158,7 @@
 cont:		s_mess("%s%s", prompt, linebuf);
 		Asking = curchar + prompt_len;
 		c = terminch();
-		if ((c == EOF) || index(delim, c)) {
+		if ((c == EOF) || strchr_ucs4(delim, c)) {
 			if (DoEVexpand)
 				EVexpand();
 			if (d_proc == 0 || (*d_proc)(c, linebuf) == 0)
@@ -310,7 +310,7 @@
 		stop = 0;
 
 	do {
-		if (ip = index(bads, ' '))
+		if (ip = strchr_ucs4 (bads, ' '))
 			*ip = 0;
 		else {
 			ip = bads + strlen(bads);
@@ -417,7 +417,7 @@
 
 	if (c == CR || c == LF)
 		return 0;	/* tells ask to return now */
-	if ((fc_filebase = rindex(buf, '/')) != 0) {
+	if ((fc_filebase = strrchr_ucs4 (buf, '/')) != 0) {
 		char	tmp[FILESIZE];
 
 		null_ncpy(tmp, buf, (++fc_filebase - buf));

Index: buf.c
===================================================================
RCS file: /local/src/CVS/jove/buf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- buf.c	19 May 2003 20:13:46 -0000	1.4
+++ buf.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -120,7 +120,7 @@
 	char		*s;
 	
 	for (s = globchars; *s; s++)
-		if (index (pattern, *s))
+		if (strchr_ucs4 (pattern, *s))
 			return 1;
 	return 0;
 }
@@ -201,7 +201,7 @@
 	int	nentries, i;
 	int	first;
 
-	if ((filebase = rindex(pattern, '/')) != 0) {
+	if ((filebase = strrchr_ucs4(pattern, '/')) != 0) {
 		null_ncpy(dir, pattern, ++filebase - pattern);
 		if (dir[0] == '\0')
 			strcpy(dir, "/");
@@ -816,6 +816,45 @@
     return result;
 }
 
+char *
+strchr_ucs4 (const char *buf, ucs4 c)
+{
+    char    utf8[10];
+    char    *f;
+    int	    l;
+    
+    if (c < 0x100) return strchr (buf, (char) c);
+    unparse_ucs4 (c, utf8);
+    l = strlen (utf8);
+    while (f = strchr (buf, utf8[0]))
+    {
+	if (!strncmp (f, utf8, l))
+	    return f;
+	buf = f + l;
+    }
+    return 0;
+}
+
+char *
+strrchr_ucs4 (const char *buf, ucs4 c)
+{
+    char    utf8[10];
+    char    *f;
+    char    *last = 0;
+    int	    l;
+    
+    if (c < 0x100) return strrchr (buf, (char) c);
+    unparse_ucs4 (c, utf8);
+    l = strlen (utf8);
+    while (f = strchr (buf, utf8[0]))
+    {
+	if (!strncmp (f, utf8, l))
+	    last = f;
+	buf = f + l;
+    }
+    return last;
+}
+
 char *buf_next (char *buf)
 {
 	if ((*buf++ & 0xc0) == 0xc0)

Index: c.c
===================================================================
RCS file: /local/src/CVS/jove/c.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- c.c	12 Aug 2004 04:29:56 -0000	1.6
+++ c.c	20 Oct 2004 05:26:40 -0000	1.7
@@ -104,7 +104,7 @@
 	REcompile(re_str, 1, re_buf, re_alts);
 	if (!p_type)
 		p_match = '\0';
-	else if (cp = index(p_types, p_type))
+	else if (cp = strchr_ucs4 (p_types, p_type))
 		p_match = cp[dir];
 	else
 		complain("[Cannot match %c's]", p_type);
@@ -349,7 +349,7 @@
 	register Bufpos	*bp;
 	register ucs4	c = cur_char ();
 
-	if ((index(p_types, c) == 0) ||
+	if ((strchr_ucs4 (p_types, c) == 0) ||
 	    (backslashed(linebuf, curchar)))
 		complain((char *) 0);
 	if (dir == FORWARD)

Index: extend.c
===================================================================
RCS file: /local/src/CVS/jove/extend.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- extend.c	10 Jun 2003 17:32:07 -0000	1.3
+++ extend.c	20 Oct 2004 05:26:40 -0000	1.4
@@ -166,7 +166,7 @@
 		} else if (c == '^') {
 			if ((c = terminch()) == '?')
 				c = RUBOUT;
-			else if (isalpha(c) || index("@[\\]^_", c))
+			else if (isalpha(c) || strchr_ucs4("@[\\]^_", c))
 				c = c - '@';
 			else
 				complain("[Unknown control character]");

Index: funcdefs.c
===================================================================
RCS file: /local/src/CVS/jove/funcdefs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- funcdefs.c	15 May 2003 00:01:06 -0000	1.2
+++ funcdefs.c	20 Oct 2004 05:26:40 -0000	1.3
@@ -666,7 +666,7 @@
 		}
 
 		/* gather the cmd name */
-		while (((c = terminch()) != EOF) && !index(" \t\r\n", c)) {
+		while (((c = terminch()) != EOF) && !strchr_ucs4(" \t\r\n", c)) {
 			*cp++ = c;
 		}
 		if (c == EOF)

Index: insert.c
===================================================================
RCS file: /local/src/CVS/jove/insert.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- insert.c	10 Oct 2004 07:36:02 -0000	1.6
+++ insert.c	20 Oct 2004 05:26:40 -0000	1.7
@@ -531,7 +531,7 @@
 	 compose; 
 	 compose = NextComposeSequence (compose))
     {
-	equal = index (compose, ':');
+	equal = strchr_ucs4 (compose, ':');
 	if (!equal)
 	    break;
 	ncompose++;
@@ -551,7 +551,7 @@
 	    compose = getCompose (which);
 	    if (!compose)
 		break;
-	    equal = index (compose, ':');
+	    equal = strchr_ucs4 (compose, ':');
 	    if (!equal)
 		break;
 	    semi = buf_next (equal+1);

Index: io.c
===================================================================
RCS file: /local/src/CVS/jove/io.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- io.c	15 May 2003 00:01:06 -0000	1.4
+++ io.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -425,7 +425,7 @@
 
 	/* Machine name */
 	if (*file == '/' && file[1] == '/' && file[2] != '/') {
-		dp = index (file+2, '/');
+		dp = strchr_ucs4 (file+2, '/');
 		if (!dp)
 		dp = file + strlen(file);
 		strncpy(into, file, dp-file);
@@ -442,7 +442,7 @@
 	dp = into + strlen(into);
 	aftermachine = into;
 	if (into[0] == '/' && into[1] == '/' && into[2] != '/') {
-		aftermachine = index (into+2, '/');
+		aftermachine = strchr_ucs4 (into+2, '/');
 		if (!aftermachine)
 			aftermachine = into + strlen (into);
 	}
@@ -451,7 +451,7 @@
 	do {
 		if (*file == 0)
 			break;
-		if (sp = index(file, '/'))
+		if (sp = strchr_ucs4(file, '/'))
 			*sp = 0;
 		if (strcmp(file, ".") == 0)
 			;	/* So it will get to the end of the loop */
@@ -503,7 +503,7 @@
 			strcpy(localbuf, HomeDir);
 			name++;
 		} else {
-			char	*uendp = index(name, '/'),
+			char	*uendp = strchr_ucs4(name, '/'),
 				unamebuf[30];
 
 			if (uendp == 0)
@@ -600,7 +600,7 @@
 		register int	c;
 
 		while (c = *cp++)
-			if ((0 <= c && c < ' ') || c == '\177' || index(badchars, c))
+			if ((0 <= c && c < ' ') || c == '\177' || strchr_ucs4(badchars, c))
 				complain("'%p': bad character in filename.", c);
 	}
 
@@ -1324,7 +1324,7 @@
 	
 	strcpy(tmp1, fname);
 	
-	if ((s = rindex(tmp1, '/')) == NULL)
+	if ((s = strrchr_ucs4(tmp1, '/')) == NULL)
 		sprintf(tmp2, "#%s", fname);
 	else {
 		*s++ = '\0';

Index: iproc-ptys.c
===================================================================
RCS file: /local/src/CVS/jove/iproc-ptys.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- iproc-ptys.c	10 Jun 2003 17:32:07 -0000	1.5
+++ iproc-ptys.c	20 Oct 2004 05:26:40 -0000	1.6
@@ -287,7 +287,7 @@
 	int		slot;
 	int		got;
 	
-	line = rindex (p->p_tty, '/');
+	line = strrchr_ucs4 (p->p_tty, '/');
 	if (line)
 		line++;
 	else

Index: iproc.c
===================================================================
RCS file: /local/src/CVS/jove/iproc.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- iproc.c	6 Sep 2004 00:39:48 -0000	1.5
+++ iproc.c	20 Oct 2004 05:26:40 -0000	1.6
@@ -799,7 +799,7 @@
 	if (!b->b_fname)
 		complain("[Buffer has no file name]");
 	real_file (b->b_fname, realname);
-	slash = rindex (realname, '/');
+	slash = strrchr_ucs4 (realname, '/');
 	if (slash)
 	{
 		if  (slash == realname)

Index: jove.h
===================================================================
RCS file: /local/src/CVS/jove/jove.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- jove.h	6 Sep 2004 00:39:48 -0000	1.9
+++ jove.h	20 Oct 2004 05:26:40 -0000	1.10
@@ -141,6 +141,8 @@
 char *unparse_ucs4 (ucs4 c, char *buf);
 char *buf_next (char *buf);
 char *buf_prev (char *buf, char *first);
+char *strchr_ucs4 (const char *buf, ucs4 c);
+char *strrchr_ucs4 (const char *buf, ucs4 c);
 #define char_at(i)	parse_ucs4(linebuf + (i))
 #define cur_char()	char_at(curchar)
 #define prev_char()	parse_ucs4(buf_prev (linebuf + curchar, linebuf))

Index: man.c
===================================================================
RCS file: /local/src/CVS/jove/man.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- man.c	6 Sep 2004 00:39:48 -0000	1.4
+++ man.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -144,13 +144,13 @@
 	char	name_part[256];
 	char	section_part[256];
 
-	op = rindex (name, '(');
+	op = strrchr_ucs4 (name, '(');
 	if (!op)
 		op = name + strlen (name);
 	strncpy (name_part, name, op - name);
 	name_part[op-name] = '\0';
 	op++;
-	cp = rindex (op, ')');
+	cp = strrchr_ucs4 (op, ')');
 	if (!cp)
 		cp = op + strlen (op);
 	strncpy (section_part, op, cp - op);
@@ -233,7 +233,7 @@
 			char	page[128];
 			char	*op;
 
-			op = rindex (name, '(');
+			op = strrchr_ucs4 (name, '(');
 			if (op)
 			{
 				strncpy (page, name, op - name);
@@ -282,7 +282,7 @@
 				char	page[128];
 				char	*op;
 
-				op = rindex (name, '(');
+				op = strrchr_ucs4 (name, '(');
 				if (op)
 				{
 					strncpy (page, name, op - name);
@@ -392,7 +392,7 @@
 		return 0;
 	len = strlen (curNamePtr);
 	if (strncmp (entry, curNamePtr, len) == 0) {
-		if (entry[len] == '.' || index (curNamePtr, '('))
+		if (entry[len] == '.' || strchr_ucs4 (curNamePtr, '('))
 			return 1;
 	}
 	return 0;
@@ -436,7 +436,7 @@
 char	*name;
 char	*buf;
 {
-	name = rindex (name, '(');
+	name = strrchr_ucs4 (name, '(');
 	if (name && name[1] != '\0') {
 		buf[0] = name[1];
 		buf[1] = '\0';
@@ -487,11 +487,11 @@
 					char	*nname;
 
 					/* Strip any trailing .gz extension */
-					dot = rindex (names[i], '.');
+					dot = strrchr_ucs4 (names[i], '.');
 					if (dot && !strcmp (dot, ".gz"))
 						*dot = '\0';
 					/* Replace .section with (section) */
-					dot = rindex (names[i], '.');
+					dot = strrchr_ucs4 (names[i], '.');
 					if (dot)
 					{
 						nname = malloc (strlen (names[i]) + 3);
@@ -542,12 +542,12 @@
 	if (*entry == '.')
 		return 0;
 	/* check for a section number */ 
-	curOp = rindex (curNamePtr, '(');
-	entryDot = rindex (entry, '.');
+	curOp = strrchr_ucs4 (curNamePtr, '(');
+	entryDot = strrchr_ucs4 (entry, '.');
 	if (entryDot && !strcmp (entryDot, ".gz"))
 	{
 		*entryDot = '\0';
-		entryDot = rindex (entry, '.');
+		entryDot = strrchr_ucs4 (entry, '.');
 	}
 	if (curOp)
 	{
@@ -557,7 +557,7 @@
 			return 0;
 		/* extract section part from current name */
 		curOp++;
-		curCp = rindex (curOp, ')');
+		curCp = strrchr_ucs4 (curOp, ')');
 		if (!curCp)
 			curCp = curOp + strlen (curOp);
 		seclen = curCp - curOp;
@@ -739,12 +739,12 @@
 	len = strlen (entry);
 	while (jove_gets(fp, line, sizeof line) != EOF) {
 		hit = line;
-		if (!commands || !(paren = index (line, '(')))
+		if (!commands || !(paren = strchr_ucs4 (line, '(')))
 			paren = line + sizeof line;
 		do {
 			if (strncmp (entry, hit, len) == 0)
 				break;
-			if (hit = index (hit, ' ')) {
+			if (hit = strchr_ucs4 (hit, ' ')) {
 				++hit;
 				if (hit >= paren)
 					hit = 0;

Index: paragraph.c
===================================================================
RCS file: /local/src/CVS/jove/paragraph.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- paragraph.c	15 May 2003 00:01:06 -0000	1.4
+++ paragraph.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -408,12 +408,12 @@
 
 		nspace = 1;
 		if (diff >= 2) {
-			while (index("\")]", parse_ucs4 (pp))) {
+			while (strchr_ucs4("\")]", parse_ucs4 (pp))) {
 				if (pp == linebuf)
 					break;
 				pp = buf_prev (pp, linebuf);
 			}
-			if (index("?!.:", parse_ucs4 (pp)))
+			if (strchr_ucs4("?!.:", parse_ucs4 (pp)))
 				nspace = 2;
 		}
 	} else

Index: re.c
===================================================================
RCS file: /local/src/CVS/jove/re.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- re.c	18 Oct 2004 04:31:16 -0000	1.5
+++ re.c	20 Oct 2004 05:26:40 -0000	1.6
@@ -114,7 +114,7 @@
 		if (c != '*')
 			last_p = comp_p;
 
-		if (kind == NORM && index(".[*", c) != 0)
+		if (kind == NORM && strchr_ucs4 (".[*", c) != 0)
 			goto defchar;
 		switch (c) {
 		case '\\':

Index: re1.c
===================================================================
RCS file: /local/src/CVS/jove/re1.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- re1.c	15 May 2003 06:00:14 -0000	1.4
+++ re1.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -348,7 +348,7 @@
 			goto gottag;
 	complain("[No such tag \"%s\"]", tag);
 gottag:	;
-	if (filebuf[0] != '/' && (ssp = rindex(tagfiles[tagI].tagfile, '/'))) 
+	if (filebuf[0] != '/' && (ssp = strrchr_ucs4(tagfiles[tagI].tagfile, '/'))) 
 	{
 		strncpy (wholefilebuf, 
 			 tagfiles[tagI].tagfile, 
@@ -502,10 +502,10 @@
 	char		*tagdir;
 	int		tagdirlen = 0;
 
-	dir = rindex (tag, '/');
+	dir = strrchr_ucs4 (tag, '/');
 	if (dir)
 	{
-		tagdir = rindex (tagfile->tagfile, '/');
+		tagdir = strrchr_ucs4 (tagfile->tagfile, '/');
 		if (!tagdir)
 		{
 			tagdir = "./" + 1;
@@ -590,7 +590,7 @@
 			break;
 		if (searchbuf && whichway == 0 && !isspace(linePtr[taglen]))
 			break;
-		nextLine = index (linePtr, '\n');
+		nextLine = strchr_ucs4 (linePtr, '\n');
 		if (!nextLine)
 			break;
 		if (whichway < 0)

Index: screen.c
===================================================================
RCS file: /local/src/CVS/jove/screen.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- screen.c	18 Oct 2004 04:31:16 -0000	1.6
+++ screen.c	20 Oct 2004 05:26:40 -0000	1.7
@@ -619,7 +619,7 @@
 			ntabs,
 			tabstp = phystab;
 
-	if (TABS && (tabstp > 0)) {
+	if ((TABS && !Utf8Out) && (tabstp > 0)) {
 		tabgoal = destcol + (tabstp / 2);
 		tabgoal -= (tabgoal % tabstp);
 
@@ -746,9 +746,9 @@
 	} else {
 		WarpHor[FORWARD].cm_numchars = dcol >= 0 ? dcol + xtracost : 1000;
 		WarpHor[BACKWARD].cm_numchars = dcol < 0 ? -(dcol + xtracost) : 1000;
-		WarpHor[FORTAB].cm_numchars = dcol >= 0 && TABS ?
+		WarpHor[FORTAB].cm_numchars = dcol >= 0 && (TABS && !Utf8Out) ?
 				ForNum(CapCol, col) + xtracost : 1000;
-		WarpHor[RETFORWARD].cm_numchars = (xtracost + 1 + (TABS ? ForNum(0, col) : col));
+		WarpHor[RETFORWARD].cm_numchars = (xtracost + 1 + ((TABS && Utf8Out) ? ForNum(0, col) : col));
 
 		/* Which is the shortest of the bunch */
 
@@ -821,7 +821,7 @@
 
 	if (from >= to)
 		return from - to;
-	if (TABS && (tabstp > 0)) {
+	if ((TABS && Utf8Out) && (tabstp > 0)) {
 		tabgoal = to + (tabstp / 2);
 		tabgoal -= (tabgoal % tabstp);
 		if (tabgoal >= CO)

Index: tune.h
===================================================================
RCS file: /local/src/CVS/jove/tune.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- tune.h	15 May 2003 00:01:07 -0000	1.4
+++ tune.h	20 Oct 2004 05:26:40 -0000	1.5
@@ -146,11 +146,6 @@
 #   endif
 #endif
 
-#ifdef SYSV
-#   define index	strchr
-#   define rindex	strrchr
-#endif
-
 /* These are here since they define things in tune.c.  If you add things to
    tune.c, add them here too, if necessary. */
 

Index: util.c
===================================================================
RCS file: /local/src/CVS/jove/util.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- util.c	10 Jun 2003 17:32:07 -0000	1.4
+++ util.c	20 Oct 2004 05:26:40 -0000	1.5
@@ -657,7 +657,7 @@
 {
 	register char	*cp;
 
-	if (cp = rindex(f, '/'))
+	if (cp = strrchr_ucs4(f, '/'))
 		return cp + 1;
 	else
 		return f;
@@ -671,7 +671,7 @@
 	register char	*t, *d;
 
 	d = dir;
-	if (t = rindex(f, '/')) {
+	if (t = strrchr_ucs4(f, '/')) {
 		while (f != t)
 			*d++ = *f++;
 	} else




More information about the Commit mailing list