/* The link is to a relative path. Prepend any leading path
in `path' to the link name. */
- linkbuf = rindex (path, '/');
+ linkbuf = strrchr (path, '/');
if (linkbuf == 0)
return xstrdup (linkname);
{
char *t;
- t = rindex (name, '/');
+ t = strrchr (name, '/');
if (t)
name = t + 1;
register char *base1, *base2;
register int cmp;
- base1 = rindex (file1->name, '.');
- base2 = rindex (file2->name, '.');
+ base1 = strrchr (file1->name, '.');
+ base2 = strrchr (file2->name, '.');
if (base1 == 0 && base2 == 0)
return strcmp (file1->name, file2->name);
if (base1 == 0)
register char *base1, *base2;
register int cmp;
- base1 = rindex (file1->name, '.');
- base2 = rindex (file2->name, '.');
+ base1 = strrchr (file1->name, '.');
+ base2 = strrchr (file2->name, '.');
if (base1 == 0 && base2 == 0)
return strcmp (file1->name, file2->name);
if (base1 == 0)
putchar ('\n');
}
\f
-/* Assuming cursor is at position FROM, indent up to position TO. */
+/* Assuming cursor is at position FROM, indent up to position TO.
+ Use a TAB character instead of two or more spaces whenever possible. */
static void
indent (from, to)
{
while (from < to)
{
- if (to / tabsize > from / tabsize)
+ if (to / tabsize > (from + 1) / tabsize)
{
putchar ('\t');
from += tabsize - from % tabsize;