From 7e6a400b101b2d20930213dfd0b8e90969e3da1d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 9 Jan 2007 01:47:03 +0000 Subject: tex4ht 1.0.2007_01_08_1711 git-svn-id: svn://tug.org/texlive/trunk@3262 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/tex4htk/t4ht.c | 93 ++++++++++++++++++++++++++++++++-------- 1 file changed, 74 insertions(+), 19 deletions(-) (limited to 'Build/source/texk/tex4htk/t4ht.c') diff --git a/Build/source/texk/tex4htk/t4ht.c b/Build/source/texk/tex4htk/t4ht.c index f2c9032bdde..cc69ab3bffd 100644 --- a/Build/source/texk/tex4htk/t4ht.c +++ b/Build/source/texk/tex4htk/t4ht.c @@ -1,7 +1,7 @@ /**********************************************************/ -/* t4ht.c 2006-09-13-14:28 */ -/* Copyright (C) 1998--2006 Eitan M. Gurari */ +/* t4ht.c 2007-01-05-03:17 */ +/* Copyright (C) 1998--2007 Eitan M. Gurari */ /* */ /* This work may be distributed and/or modified under the */ /* conditions of the LaTeX Project Public License, either */ @@ -388,6 +388,7 @@ static Q_CHAR *Dotfield = Q_NULL; static Q_CHAR *dir = Q_NULL; static Q_CHAR *lg_name = Q_NULL, tmp_name[255], job_name[255]; static Q_CHAR *nopict = Q_NULL; +static Q_CHAR *bitmaps_no_dm = Q_NULL; static BOOL newchmod = FALSE; static Q_CHAR *noreuse = Q_NULL; @@ -439,6 +440,7 @@ static C_CHAR *warn_err_mssg[]={ "\n--------------------------------------------------------------------\n" "t4ht [-f]filename ...\n" +" -b ignore -d -m -M for bitmaps\n" " -c... choose named segment in env file\n" " -d... directory for output files (default: current)\n" " -e... location of tex4ht.env\n" @@ -653,6 +655,12 @@ static void execute_script #endif { struct script_struct* temp; Q_CHAR *p, *q, *t; + +#ifdef KPATHSEA +char * texmf = (char *) kpse_var_value( "SELFAUTOPARENT" ); +#endif + + temp = script; system_return = 0; while( temp ){ @@ -661,7 +669,9 @@ q = command; while( *p != '\0' ){ *q = *(p++); if( (*q == '%') && (*p == '%') - && ((*(p+1) == '%') || ( (*(p+1) >= '0') && (*(p+1) < '5') ) ) + && ( (*(p+1) == '%') + || (*(p+1) == '~') + || ( (*(p+1) >= '0') && (*(p+1) < '5') ) ) ){ p++; switch( *(p++) ){ case '%':{ q++; break; } @@ -675,6 +685,19 @@ while( *p != '\0' ){ while( *t != '\0' ){ *(q++) = *(t++); } break; } case '4':{ t = match_4; while( *t != '\0' ){ *(q++) = *(t++); } break; } + case '~':{ +#ifdef KPATHSEA + if( texmf ){ + t = texmf; + while( *t != '\0' ){ *(q++) = *(t++); } + } else { + *(q++) = '~'; + } +#else + *(q++) = '~'; +#endif + + break; } default: { } }} else { q++; } } @@ -893,7 +916,7 @@ char *get_env_dir Q_CHAR *p; if(! progname || ! *progname) return NULL; i = (int) strlen(progname); - while( (progname[--i] != dir_path_slash(progname) ) + while( (progname[--i] != (int) dir_path_slash(progname) ) && i > 0) ; if(i == 0) return NULL; p = (Q_CHAR *) malloc(i+12); @@ -1425,17 +1448,48 @@ SetConsoleCtrlHandler((PHANDLER_ROUTINE)sigint_handler, TRUE); (IGNORED) printf("----------------------------\n"); #ifndef KPATHSEA #ifdef PLATFORM - (IGNORED) printf("t4ht.c (2006-09-13-14:28 %s)\n",PLATFORM); + (IGNORED) printf("t4ht.c (2007-01-05-03:17 %s)\n",PLATFORM); #else - (IGNORED) printf("t4ht.c (2006-09-13-14:28)\n"); + (IGNORED) printf("t4ht.c (2007-01-05-03:17)\n"); #endif #else #ifdef PLATFORM - (IGNORED) printf("t4ht.c (2006-09-13-14:28 %s kpathsea)\n",PLATFORM); + (IGNORED) printf("t4ht.c (2007-01-05-03:17 %s kpathsea)\n",PLATFORM); #else - (IGNORED) printf("t4ht.c (2006-09-13-14:28 kpathsea)\n"); -#endif -#endif + (IGNORED) printf("t4ht.c (2007-01-05-03:17 kpathsea)\n"); +#endif +#endif + + +{ int i, count = 0; + for(i=0; in if( !skip ){ (void) execute_script(empty_fig_script, - dir? dir :"", match[3],"",""); - if( ch_mod && !system_return ){ + (dir && !bitmaps_no_dm )? dir :"", match[3],"",""); + if( ch_mod && !bitmaps_no_dm && !system_return ){ (void) execute_script(chmod_script, ch_mod, dir?dir:"",match[3], ""); } @@ -2501,10 +2556,10 @@ filtered_dvigif_script = filterGifScript(dvigif_script, match[3]); (void) execute_script( filtered_dvigif_script,match[1],match[2],match[3],job_name); (void) free_script( filtered_dvigif_script ); -if( dir && !system_return ){ +if( dir && !bitmaps_no_dm && !system_return ){ (void) execute_script(move_script,match[3],dir,".",""); } -if( ch_mod && !system_return ){ +if( ch_mod && !bitmaps_no_dm && !system_return ){ (void) execute_script(chmod_script, ch_mod, dir?dir:"",match[3], ""); } -- cgit v1.2.3