[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge branch 'remove_inpu_path_from_output_path' of https://github.co…
Browse files Browse the repository at this point in the history
…m/martonmiklos/dbcc into martonmiklos-remove_inpu_path_from_output_path
  • Loading branch information
howerj committed Nov 16, 2018
2 parents 5d24f1d + 8233346 commit 3d62a67
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @copyright Richard James Howe
* @license MIT */
#include <assert.h>
#include <libgen.h>
#include <stdint.h>
#include "mpc.h"
#include "util.h"
Expand Down Expand Up @@ -196,18 +197,18 @@ int main(int argc, char **argv)

dbc_t *dbc = ast2dbc(ast);

char *outpath = argv[i];
char *outpath = basename(argv[i]);
if(outdir) {
outpath = allocate(strlen(outpath) + strlen(outdir) + 2 /* '/' + '\0'*/);
strcat(outpath, outdir);
strcat(outpath, "/");
strcat(outpath, argv[i]);
strcat(outpath, basename(argv[i]));
}

int r = 0;
switch(convert) {
case CONVERT_TO_C:
r = dbc2cWrapper(dbc, outpath, argv[i], use_time_stamps,
r = dbc2cWrapper(dbc, outpath, basename(argv[i]), use_time_stamps,
generate_print, generate_pack, generate_unpack);
break;
case CONVERT_TO_XML:
Expand Down

0 comments on commit 3d62a67

Please sign in to comment.