From 2149db8294e3938ad24cf00b066e3c3b522ba880 Mon Sep 17 00:00:00 2001 From: Miller Puckette <msp@ucsd.edu> Date: Mon, 7 Jan 2008 14:37:47 -0800 Subject: [PATCH] bugfix for long paths --- src/s_main.c | 8 +++++--- src/s_path.c | 26 ++++++-------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/s_main.c b/src/s_main.c index 3396e9939..c49209147 100644 --- a/src/s_main.c +++ b/src/s_main.c @@ -386,7 +386,7 @@ static char *(usagemessage[]) = { "-open <file> -- open file(s) on startup\n", "-lib <file> -- load object library(s)\n", "-font-size <n> -- specify default font size in points\n", -"-font-face <name> -- specify default font (default: Bitstream Vera Sans Mono)\n", +"-font-face <name> -- specify default font\n", "-font-weight <name>-- specify default font weight (normal or bold)\n", "-verbose -- extra printout on startup and when searching for files\n", "-version -- don't run Pd; just print out which version it is \n", @@ -747,13 +747,15 @@ int sys_argparse(int argc, char **argv) sys_externlist = namelist_append_files(sys_externlist, argv[1]); argc -= 2; argv += 2; } - else if ((!strcmp(*argv, "-font-size") || !strcmp(*argv, "-font")) && argc > 1) + else if ((!strcmp(*argv, "-font-size") || !strcmp(*argv, "-font")) + && argc > 1) { sys_defaultfont = sys_nearestfontsize(atoi(argv[1])); argc -= 2; argv += 2; } - else if ((!strcmp(*argv, "-font-face") || !strcmp(*argv, "-typeface")) && argc > 1) + else if ((!strcmp(*argv, "-font-face") || !strcmp(*argv, "-typeface")) + && argc > 1) { strncpy(sys_font,*(argv+1),sizeof(sys_font)-1); sys_font[sizeof(sys_font)-1] = 0; diff --git a/src/s_path.c b/src/s_path.c index 6abe7d0c2..0d9728619 100644 --- a/src/s_path.c +++ b/src/s_path.c @@ -523,16 +523,9 @@ void glob_start_path_dialog(t_pd *dummy) int i; t_namelist *nl; - sprintf(buf, "list"); - for (nl = sys_searchpath, i = 0; nl; nl = nl->nl_next, i++) { - if(nl->nl_string){ - strcat(buf, " \""); - strcat(buf, nl->nl_string); - strcat(buf, "\""); - } - } - sys_vgui("pd_set pd_path [%s]\n", buf); - + sys_vgui("pd_set pd_path \"\"\n"); + for (nl = sys_searchpath, i = 0; nl; nl = nl->nl_next, i++) + sys_vgui("lappend pd_path \"%s\"\n", nl->nl_string); sprintf(buf, "pdtk_path_dialog %%s %d %d\n", sys_usestdpath, sys_verbose); gfxstub_new(&glob_pdobject, (void *)glob_start_path_dialog, buf); } @@ -560,16 +553,9 @@ void glob_start_startup_dialog(t_pd *dummy) int i; t_namelist *nl; - sprintf(buf, "list"); - for (nl = sys_externlist, i = 0; nl; nl = nl->nl_next, i++) { - if(nl->nl_string){ - strcat(buf, " \""); - strcat(buf, nl->nl_string); - strcat(buf, "\""); - } - } - sys_vgui("pd_set pd_startup [%s]\n", buf); - + sys_vgui("pd_set pd_startup \"\"\n"); + for (nl = sys_externlist, i = 0; nl; nl = nl->nl_next, i++) + sys_vgui("lappend pd_startup \"%s\"\n", nl->nl_string); sprintf(buf, "pdtk_startup_dialog %%s %d \"%s\"\n", sys_defeatrt, sys_flags->s_name); gfxstub_new(&glob_pdobject, (void *)glob_start_startup_dialog, buf); -- GitLab