Re: a little note on ^Ms

myers@indy.net
Date: 11/24/95


> 
> On Fri, 24 Nov 1995, Greg Alexander Irvine wrote:
> 
> the problem isn't with the ^Ms, its with the program writing the ^Ms, i 
> suppose we could all put a dos2unix command for every file in autorun, 
> but that would be more hassle than its worth


It seems more worthwhile to filter each string before it is written.

A function to do so could be something like:
void strip(char *string)
{
   char *tmp = string;

   while(*tmp){
     if((int)(*tmp) != STRIP_CHAR)
        *string++ = *tmp;
     tmp++;
   }

   *string = '\0';      
         
}

Where STRIP_CHAR is the ascii value of ^M (is it 13?).  This should
work, but since it is off the top of my head I don't know.



This archive was generated by hypermail 2b30 : 12/07/00 PST