<<< Date Index >>>     <<< Thread Index >>>

[Mutt] #2989: strsep not available on solaris



#2989: strsep not available on solaris

 Hi,

 Commit 5307:033eba2d6834 broke Solaris build, as we don't have strsep
 function. While looking around for alternative solution, I found this
 reference:

 http://www.winehq.org/pipermail/wine-patches/2001-November/001322.html

 /******************************************************************************
 * This is a replacement for strsep which is not portable (missing on
 Solaris).
 */
 static char* getToken(char** str, const char* delims)
 {
     char* token;

     if (*str==NULL) {
         /* No more tokens */
         return NULL;
     }

     token=*str;
     while (**str!='\0') {
         if (strchr(delims,**str)!=NULL) {
             **str='\0';
             (*str)++;
             return token;
         }
         (*str)++;
     }
     /* There is no other token */
     *str=NULL;
     return token;
 }

 /******************************************************************************

 Thanks

 --
   Vlad

-- 
Ticket URL: <http://dev.mutt.org/trac/ticket/2989>