summaryrefslogtreecommitdiff
path: root/ccdv.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-10-15 18:42:42 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 22:02:44 -0700
commitf837727408d862f0f23fe46f617d2060f0bd3aed (patch)
tree47c38486232ea36b4ee01d4ec9c00b52cc6b6d26 /ccdv.c
parent92307b9e7bb08e1086d213617df3552e3ff53d75 (diff)
downloadsystemd-f837727408d862f0f23fe46f617d2060f0bd3aed.tar.gz
systemd-f837727408d862f0f23fe46f617d2060f0bd3aed.tar.bz2
systemd-f837727408d862f0f23fe46f617d2060f0bd3aed.zip
[PATCH] tweak the ccdv program to handle files in subdirectories being built.
Diffstat (limited to 'ccdv.c')
-rw-r--r--ccdv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ccdv.c b/ccdv.c
index 069cc461de..e3ae9da91a 100644
--- a/ccdv.c
+++ b/ccdv.c
@@ -28,12 +28,12 @@
size_t gNBufUsed = 0, gNBufAllocated = 0;
char *gBuf = NULL;
int gCCPID;
-char gAction[64] = "";
-char gTarget[64] = "";
+char gAction[200] = "";
+char gTarget[200] = "";
char gAr[32] = "";
char gArLibraryTarget[64] = "";
int gDumpCmdArgs = 0;
-char gArgsStr[800];
+char gArgsStr[1000];
int gColumns = 80;
int gANSIEscapes = 0;
int gExitStatus = 95;
@@ -250,6 +250,7 @@ static const char * Extension(const char *path)
cp = strrchr(path, '.');
if (cp == NULL)
return ("");
+ // printf("Extension='%s'\n", cp);
return (cp);
} /* Extension */
@@ -289,6 +290,7 @@ int main(int argc, char **argv)
snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1]));
memset(gArgsStr, 0, sizeof(gArgsStr));
for (i = 1; i < argc; i++) {
+ // printf("argv[%d]='%s'\n", i, argv[i]);
quote = (strchr(argv[i], ' ') != NULL) ? "\"" : "";
snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : "");
if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) {
@@ -296,11 +298,12 @@ int main(int argc, char **argv)
strcpy(gAction, "Linking");
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1]));
}
- } else if (strchr("-+/", (int) argv[i][0]) != NULL) {
+ } else if (strchr("-+", (int) argv[i][0]) != NULL) {
continue;
} else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) {
cc++;
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));
+ // printf("gTarget='%s'\n", gTarget);
} else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) {
pch++;
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));