/[graveman]/graveman/current/src/tools.c
ViewVC logotype

Diff of /graveman/current/src/tools.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by scresto, Tue May 17 01:16:34 2005 UTC revision 1.25 by scresto, Sat May 28 01:30:50 2005 UTC
# Line 496  gboolean read_all_output_callback(GIOCha Line 496  gboolean read_all_output_callback(GIOCha
496    return TRUE;    return TRUE;
497  }  }
498    
499    /* escape each of 'Aescape' characters who are present in Abuf */
500    gchar *sc_escape(gchar *Abuf, gint Asizemax, gchar *Aescape)
501    {
502      gchar *Adbl = g_strdup(Abuf);
503      gint i, j;
504    
505      for (i=0, j=0; i < Asizemax && j < Asizemax-1 && Adbl[i]; i++) {
506        if (strchr(Aescape, Adbl[i])) {
507          Abuf[j++]='\\';
508        }
509        Abuf[j++]=Adbl[i];
510      }
511      g_free(Adbl);
512      Abuf[j]=0;
513    
514      return Abuf;
515    }
516    
517  /*  /*
518   * vim:et:ts=8:sts=2:sw=2   * vim:et:ts=8:sts=2:sw=2
519   */   */

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26