Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71659
b: refs/heads/master
c: bb13be5
h: refs/heads/master
i:
  71657: 40cdffa
  71655: 03f66a9
v: v3
  • Loading branch information
Rob Landley authored and Sam Ravnborg committed Oct 18, 2007
1 parent 348dd3d commit 398902d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b21960f90d4d011e49e386d0525b1e89f320658
refs/heads/master: bb13be5145e18cfb3a2f9cc6091aa048d032a3cd
11 changes: 9 additions & 2 deletions trunk/scripts/basic/docproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ FILELINE * entity_system;
#define FUNCTION "-function"
#define NOFUNCTION "-nofunction"

char *srctree;

void usage (void)
{
fprintf(stderr, "Usage: docproc {doc|depend} file\n");
fprintf(stderr, "Input is read from file.tmpl. Output is sent to stdout\n");
fprintf(stderr, "doc: frontend when generating kernel documentation\n");
fprintf(stderr, "depend: generate list of files referenced within file\n");
fprintf(stderr, "Environment variable SRCTREE: absolute path to kernel source tree.\n");
}

/*
Expand All @@ -90,7 +93,7 @@ void exec_kernel_doc(char **svec)
exit(1);
case 0:
memset(real_filename, 0, sizeof(real_filename));
strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
strncat(real_filename, srctree, PATH_MAX);
strncat(real_filename, KERNELDOCPATH KERNELDOC,
PATH_MAX - strlen(real_filename));
execvp(real_filename, svec);
Expand Down Expand Up @@ -171,7 +174,7 @@ void find_export_symbols(char * filename)
if (filename_exist(filename) == NULL) {
char real_filename[PATH_MAX + 1];
memset(real_filename, 0, sizeof(real_filename));
strncat(real_filename, getenv("SRCTREE"), PATH_MAX);
strncat(real_filename, srctree, PATH_MAX);
strncat(real_filename, filename,
PATH_MAX - strlen(real_filename));
sym = add_new_file(filename);
Expand Down Expand Up @@ -338,6 +341,10 @@ void parse_file(FILE *infile)
int main(int argc, char *argv[])
{
FILE * infile;

srctree = getenv("SRCTREE");
if (!srctree)
srctree = getcwd(NULL, 0);
if (argc != 3) {
usage();
exit(1);
Expand Down

0 comments on commit 398902d

Please sign in to comment.