mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Native_File_Chooser_WIN32.cxx
static void dnullcat(char*&wp, const char *string, int n = -1 ) {
  //DEBUG printf("DEBUG: dnullcat IN: <"); dnullprint(wp); printf(">\n");
  int inlen = ( n < 0 ) ? strlen(string) : n;
  if ( ! wp ) {
    wp = new char[inlen + 4];
    *(wp+0) = '\0';
    *(wp+1) = '\0';
  } else {
    int wplen = dnulllen(wp);
    // Make copy of wp into larger buffer
    char *tmp = new char[wplen + inlen + 4];
    memcpy(tmp, wp, wplen+2);	// copy of wp plus doublenull
    delete [] wp;			// delete old wp
    wp = tmp;			// use new copy
    //DEBUG printf("DEBUG: dnullcat COPY: <"); dnullprint(wp); printf("> (wplen=%d)\n", wplen);
  }

  // Find end of double null string
  //     *wp2 is left pointing at second null.
  //
  char *wp2 = wp;
  if ( *(wp2+0) != '\0' && *(wp2+1) != '\0' ) {
    for ( ; 1; wp2++ ) {
      if ( *(wp2+0) == '\0' && *(wp2+1) == '\0' ) {
        wp2++;
        break;
      }
    }
  }

  if ( n == -1 ) n = strlen(string);
  strncpy(wp2, string, n);

  // Leave string double-null terminated
  *(wp2+n+0) = '\0';
  *(wp2+n+1) = '\0';
  //DEBUG printf("DEBUG: dnullcat OUT: <"); dnullprint(wp); printf(">\n\n");
}
// STATIC: Append a string to another, leaving terminated with DOUBLE NULL.
//     Automatically handles extending length of string.
//     wp can be NULL (a new wp will be allocated and initialized).
//     string must be NULL terminated.
//     The pointer wp may be modified on return.
//
Append a string to another, leaving terminated with DOUBLE NULL.
Automatically handles extending length of string.
wp can be NULL (a new wp will be allocated and initialized).
string must be NULL terminated.
The pointer wp may be modified on return.
Append a string to another leaving terminated with DOUBLE NULL . Automatically handles extending length of string . wp can be NULL ( a new wp will be allocated and initialized ) . string must be NULL terminated . The pointer wp may be modified on return .
static void dnullcat(char*&wp, const char *string, int n = -1 ) {
  int inlen = ( n < 0 ) ? strlen(string) : n;
  if ( ! wp ) {
    wp = new char[inlen + 4];
    *(wp+0) = '\0';
    *(wp+1) = '\0';
  } else {
    int wplen = dnulllen(wp);
    char *tmp = new char[wplen + inlen + 4];
    memcpy(tmp, wp, wplen+2);	
    delete [] wp;			
    wp = tmp;			
  }
  char *wp2 = wp;
  if ( *(wp2+0) != '\0' && *(wp2+1) != '\0' ) {
    for ( ; 1; wp2++ ) {
      if ( *(wp2+0) == '\0' && *(wp2+1) == '\0' ) {
        wp2++;
        break;
      }
    }
  }
  if ( n == -1 ) n = strlen(string);
  strncpy(wp2, string, n);
   Leave string double-null terminated
  *(wp2+n+0) = '\0';
  *(wp2+n+1) = '\0';
  DEBUG printf("DEBUG: dnullcat OUT: <"); dnullprint(wp); printf(">\n\n");
}
static void dnullcat ( char * & wp , const char * string , int n = -1 ) { int inlen = ( n < 0 ) ? strlen ( string ) : n ; if ( ! wp ) { wp = new char [ inlen + 4 ] ; * ( wp + 0 ) = ' \0 ' ; * ( wp + 1 ) = ' \0 ' ; } else { int wplen = dnulllen ( wp ) ; char * tmp = new char [ wplen + inlen + 4 ] ; memcpy ( tmp , wp , wplen + 2 ) ; delete [ ] wp ; wp = tmp ; } char * wp2 = wp ; if ( * ( wp2 + 0 ) != ' \0 ' && * ( wp2 + 1 ) != ' \0 ' ) { for ( ; 1 ; wp2 ++ ) { if ( * ( wp2 + 0 ) == ' \0 ' && * ( wp2 + 1 ) == ' \0 ' ) { wp2 ++ ; break ; } } } if ( n == -1 ) n = strlen ( string ) ; strncpy ( wp2 , string , n ) ; * ( wp2 + n + 0 ) = ' \0 ' ; * ( wp2 + n + 1 ) = ' \0 ' ; }
STATIC: Append a string to another, leaving terminated with DOUBLE NULL.
STATIC : Append a string to another leaving terminated with DOUBLE NULL .
//DEBUG printf("DEBUG: dnullcat IN: <"); dnullprint(wp); printf(">\n"); // Make copy of wp into larger buffer // copy of wp plus doublenull // delete old wp // use new copy //DEBUG printf("DEBUG: dnullcat COPY: <"); dnullprint(wp); printf("> (wplen=%d)\n", wplen); // Find end of double null string //     *wp2 is left pointing at second null. // // Leave string double-null terminated //DEBUG printf("DEBUG: dnullcat OUT: <"); dnullprint(wp); printf(">\n\n");