diff options
author | msvensson@pilot.blaudden <> | 2007-04-23 14:01:48 +0200 |
---|---|---|
committer | msvensson@pilot.blaudden <> | 2007-04-23 14:01:48 +0200 |
commit | 1561c39c5d91370178999584ddd30d7314ce1a8a (patch) | |
tree | 6dcdf535a8395ea3fc572f84b12eb31c53f45e35 /scripts/comp_sql.c | |
parent | 7ddc33753ec338969a205e5ff9904d74ccb973c7 (diff) | |
download | mariadb-git-1561c39c5d91370178999584ddd30d7314ce1a8a.tar.gz |
Add "name of struct" as first arg to comp_sql
Fix "make distcheck"
Diffstat (limited to 'scripts/comp_sql.c')
-rw-r--r-- | scripts/comp_sql.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/comp_sql.c b/scripts/comp_sql.c index 53359d384c1..88e88e632b6 100644 --- a/scripts/comp_sql.c +++ b/scripts/comp_sql.c @@ -58,12 +58,12 @@ static void die(const char *fmt, ...) int main(int argc, char *argv[]) { char buff[512]; - char* infile_name= argv[1]; - char* outfile_name= argv[2]; - char* end= infile_name; + char* struct_name= argv[1]; + char* infile_name= argv[2]; + char* outfile_name= argv[3]; - if (argc != 3) - die("Usage: comp_sql <sql_filename> <c_filename>"); + if (argc != 4) + die("Usage: comp_sql <struct_name> <sql_filename> <c_filename>"); /* Open input and output file */ if (!(in= fopen(infile_name, "r"))) @@ -71,10 +71,7 @@ int main(int argc, char *argv[]) if (!(out= fopen(outfile_name, "w"))) die("Failed to open output file '%s'", outfile_name); - while(*end && *end != '.') - end++; - *end= 0; - fprintf(out, "const char* %s={\n\"", infile_name); + fprintf(out, "const char* %s={\n\"", struct_name); while (fgets(buff, sizeof(buff), in)) { |