Replaced calls to the custom strindex() and strrindex() functions with the
exactly equivalent and standard strchr() and strrchr() functions instead.
This commit is contained in:
@@ -20,12 +20,12 @@ getwdir(fn)
|
||||
char *fn;
|
||||
{
|
||||
register char *p;
|
||||
char *strrindex();
|
||||
char *strrchr();
|
||||
|
||||
p = strrindex(fn, '/');
|
||||
p = strrchr(fn, '/');
|
||||
while (p && *(p + 1) == '\0') { /* remove trailing /'s */
|
||||
*p = '\0';
|
||||
p = strrindex(fn, '/');
|
||||
p = strrchr(fn, '/');
|
||||
}
|
||||
|
||||
if (fn[0] == '\0' || (fn[0] == '/' && p == &fn[0])) /* absolute path */
|
||||
|
||||
@@ -93,7 +93,7 @@ compile(argc, argv)
|
||||
}
|
||||
|
||||
struct idf *file_head;
|
||||
extern char *strrindex();
|
||||
extern char *strrchr();
|
||||
|
||||
list_dependencies(source)
|
||||
char *source;
|
||||
@@ -101,7 +101,7 @@ list_dependencies(source)
|
||||
register struct idf *p = file_head;
|
||||
|
||||
if (source) {
|
||||
register char *s = strrindex(source, '.');
|
||||
register char *s = strrchr(source, '.');
|
||||
|
||||
if (s && *(s+1)) {
|
||||
s++;
|
||||
@@ -111,7 +111,7 @@ list_dependencies(source)
|
||||
* object generated, so don't include the pathname
|
||||
* leading to it.
|
||||
*/
|
||||
if (s = strrindex(source, '/')) {
|
||||
if (s = strrchr(source, '/')) {
|
||||
source = s + 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user