Changeset aa709a5 in tol


Ignore:
Timestamp:
Jan 2, 2012, 8:32:08 PM (15 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
c495c08
Parents:
caff45d
Message:

refs #1118, POpen compilado en windows. Si los argumentos contienen espacios hay que protegerlo con \"\", ej:

!java
Set dir = POpen( [[ "dir", "\"c:\\Archivos de Programa\"" ]] );
WriteLn( dir::output );

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3978 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/set_type/setgra.cpp

    rcaff45d raa709a5  
    27962796          BOperClassify::System_);
    27972797
     2798#define POPEN
    27982799#ifdef POPEN
    27992800//--------------------------------------------------------------------
    … …  
    28082809    int badArg = 0;
    28092810    for ( int i = 1; i <= args.Card(); i++ ) {
    2810       cmd += '"';
    28112811      BSyntaxObject* arg  = args[ i ];
    28122812      if ( arg->Grammar() != GraText() ) {
    … …  
    28172817      }
    28182818      const BText &txt = Text( arg );
     2819          /*
     2820          char *start = txt.Buffer();
     2821          char *end ;
     2822          char *tmp = new char[ txt.Length() ];
     2823          do {
     2824                end = start;
     2825                int bs = 0;
     2826                while ( *end ) {
     2827                  if ( !bs && isspace( *end ) ) break;
     2828                  bs = *end == '\\';
     2829                  ++end
     2830                }
     2831          }
     2832          while ( *end ) {
     2833            cmd += strncpy( tmp, start, end - start );
     2834                cmd += "\\ ";
     2835                start = end + 1;
     2836          }
     2837          delete []tmp;
     2838          */
    28192839      cmd += txt;
    2820       cmd += "\" ";
     2840      cmd += " ";
    28212841    }
    28222842    if ( !badArg ) {
     2843      //Std( BText( "*** '" ) + cmd + "' ***" );
    28232844      FILE* pipe = popen(cmd, "r");
    28242845      if ( pipe ) {
Note: See TracChangeset for help on using the changeset viewer.