Skip to content

Commit

Permalink
hotfix: handle trailing slash of OREGANO_MODELDIR, closes #149
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Nov 20, 2015
1 parent e5e8ead commit 608da4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/engines/ngspice.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ static GString *ngspice_generate_netlist_buffer (OreganoEngine *engine, GError *
g_string_append (buffer, "*------------- Models -------------------------\n");
for (iter = output.models; iter; iter = iter->next) {
const gchar *model = iter->data;
g_string_append_printf (buffer, ".include %s/%s.model\n", OREGANO_MODELDIR, model);
const gchar *model_with_ext = g_strdup_printf ("%s.model", model);
const gchar *model_path = g_build_filename (OREGANO_MODELDIR, model_with_ext, NULL);
g_string_append_printf (buffer, ".include %s\n", model_path);
g_free (model_path);
g_free (model_with_ext);
}

// Prints template parts
Expand Down

0 comments on commit 608da4f

Please sign in to comment.