Changeset 809adb5 in git for modules/modgen


Ignore:
Timestamp:
Apr 6, 2006, 9:46:13 PM (18 years ago)
Author:
Anne Frühbis-Krüger <anne@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
91329a9b65526a851a4d7c7fbf602058f17a0a26
Parents:
254a94285388c665a03760a37dabbbacbe7046b9
Message:
*anne: fixed linefeed problem in strings from .mod file for strings
       help, example


git-svn-id: file:///usr/local/Singular/svn/trunk@9062 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/modgen/proc.cc

    r254a942 r809adb5  
    11/*
    2  * $Id: proc.cc,v 1.23 2003-06-11 21:33:18 krueger Exp $
     2 * $Id: proc.cc,v 1.24 2006-04-06 19:46:13 anne Exp $
    33 */
    44
     
    523523  )
    524524{
     525  unsigned int i;
    525526  if(pi->help_string!=NULL) {
    526527    fprintf(module->fmtfp2, "#line %d \"%s\"\n", pi->lineno_other,
    527528            module->filename);
    528529    fprintf(module->fmtfp2, "  enter_id(\"%s_help\",", pi->procname);
    529     fprintf(module->fmtfp2, " \"%s\", STRING_CMD);\n\n", pi->help_string);
     530    fprintf(module->fmtfp2, " \"");
     531    for(i=0; i<strlen(pi->help_string); i++) {
     532        if(pi->help_string[i]=='\n') fprintf(module->fmtfp2,"\\n");
     533        else fprintf(module->fmtfp2,"%c", pi->help_string[i]);
     534    }
     535    fprintf(module->fmtfp2, "\", STRING_CMD);\n\n", pi->help_string);
    530536  }
    531537}
     
    537543  )
    538544{
     545  unsigned int i;
    539546  /* if proc is NULL, just return */
    540547  if( pi == NULL ) return;
     
    544551            module->filename);
    545552    fprintf(module->fmtfp3, "  enter_id(\"%s_example\",\n", pi->procname);
    546     fprintf(module->fmtfp3, " \"%s\", STRING_CMD);\n\n", pi->example_string);
     553    fprintf(module->fmtfp3, " \"");
     554    for(i=0; i<strlen(pi->example_string); i++) {
     555        if(pi->example_string[i]=='\n') fprintf(module->fmtfp3,"\\n");
     556        else fprintf(module->fmtfp3,"%c", pi->example_string[i]);
     557    }
     558    fprintf(module->fmtfp3, "\", STRING_CMD);\n\n", pi->example_string);
    547559  }
    548560}
Note: See TracChangeset for help on using the changeset viewer.