Use basename(filename) in "Generated from %s" comments in output files,

to avoid embedding the path to the build tree.
This commit is contained in:
apb 2014-01-18 09:20:36 +00:00
parent 544c834ab7
commit 85defa7795
2 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: gen.c,v 1.1.1.1 2011/04/13 18:14:40 elric Exp $ */
/* $NetBSD: gen.c,v 1.2 2014/01/18 09:20:36 apb Exp $ */
/*
* Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan
@ -36,8 +36,9 @@
*/
#include "gen_locl.h"
#include <libgen.h>
__RCSID("$NetBSD: gen.c,v 1.1.1.1 2011/04/13 18:14:40 elric Exp $");
__RCSID("$NetBSD: gen.c,v 1.2 2014/01/18 09:20:36 apb Exp $");
FILE *privheaderfile, *headerfile, *codefile, *logfile, *templatefile;
@ -155,7 +156,7 @@ init_generate (const char *filename, const char *base)
fprintf (headerfile,
"/* Generated from %s */\n"
"/* Do not edit */\n\n",
filename);
basename(filename));
fprintf (headerfile,
"#ifndef __%s_h__\n"
"#define __%s_h__\n\n", headerbase, headerbase);
@ -268,7 +269,7 @@ init_generate (const char *filename, const char *base)
"#include <errno.h>\n"
"#include <limits.h>\n"
"#include <krb5/krb5-types.h>\n",
filename);
basename(filename));
fprintf (templatefile,
"#include <%s>\n"
@ -366,7 +367,7 @@ generate_header_of_codefile(const char *name)
"#include <errno.h>\n"
"#include <limits.h>\n"
"#include <krb5/krb5-types.h>\n",
orig_filename);
basename(orig_filename));
fprintf (codefile,
"#include <%s>\n"

View File

@ -1,4 +1,4 @@
/* $NetBSD: compile_et.c,v 1.1.1.1 2011/04/13 18:14:43 elric Exp $ */
/* $NetBSD: compile_et.c,v 1.2 2014/01/18 09:20:36 apb Exp $ */
/*
* Copyright (c) 1998-2002 Kungliga Tekniska Högskolan
@ -39,6 +39,7 @@
#include "compile_et.h"
#include <getarg.h>
#include <libgen.h>
#include <roken.h>
#include <err.h>
@ -77,7 +78,7 @@ generate_c(void)
if(c_file == NULL)
return 1;
fprintf(c_file, "/* Generated from %s */\n", filename);
fprintf(c_file, "/* Generated from %s */\n", basename(filename));
if(id_str)
fprintf(c_file, "/* %s */\n", id_str);
fprintf(c_file, "\n");
@ -142,7 +143,7 @@ generate_h(void)
if(!isalnum((unsigned char)*p))
*p = '_';
fprintf(h_file, "/* Generated from %s */\n", filename);
fprintf(h_file, "/* Generated from %s */\n", basename(filename));
if(id_str)
fprintf(h_file, "/* %s */\n", id_str);
fprintf(h_file, "\n");