-
Notifications
You must be signed in to change notification settings - Fork 1
/
fixdep.c
50 lines (42 loc) · 1 KB
/
fixdep.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* fixdep.c
*
* A quick program to fix the .d files used for dependancies
*/
/* $Id: fixdep.c,v 1.3 2000/04/15 15:29:31 nyef Exp $ */
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
char buffer[8192]; /* should be more than enough */
char *bufptr;
if (argc == 2) {
strcpy(buffer, argv[1]);
bufptr = buffer + strlen(buffer);
} else {
bufptr = buffer;
}
bufptr = bufptr + fread(bufptr, 1, 8191, stdin);
*bufptr = '\0';
fputs(buffer, stdout);
for (bufptr = buffer; *bufptr != '\0'; bufptr++) {
if (*(bufptr+1) == ':') {
*bufptr = 'd';
break;
}
}
fputs(buffer, stdout);
return 0;
}
/*
* $Log: fixdep.c,v $
* Revision 1.3 2000/04/15 15:29:31 nyef
* added an optional directory prefix parameter (workaround for gcc misfeature)
*
* Revision 1.2 2000/04/15 02:05:18 nyef
* fixed typo that broke dependancies on any file with a '0' in the name
*
* Revision 1.1 2000/03/20 03:35:39 nyef
* Initial revision
*
*/