< prev index next >

src/java.desktop/unix/native/common/awt/fontpath.c

Print this page




 269     /* if it fails free things and get out */
 270     if ( newFontPath == NULL ) {
 271       free ( ( void *) appendDirList );
 272       XFreeFontPath ( origFontPath );
 273       return;
 274     }
 275 
 276     for ( origIndex = 0; origIndex < nPaths; origIndex++ ) {
 277       onePath = origFontPath[origIndex];
 278       newFontPath[origIndex] = onePath;
 279     }
 280 
 281     /* now add the other font paths */
 282 
 283     for (index = 0; index < fDirP->num; index++ ) {
 284 
 285       if ( appendDirList[index] == 1 ) {
 286 
 287         /* printf ( "Appending %s\n", fDirP->name[index] ); */
 288 
 289         onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) );
 290         if (onePath == NULL) {
 291             free ( ( void *) appendDirList );
 292 
 293             for ( index = origIndex; index < nPaths; index++ ) {
 294                 free( newFontPath[index] );
 295             }
 296 
 297             free( ( void *) newFontPath);
 298             XFreeFontPath ( origFontPath );
 299             return;
 300         }
 301         strcpy ( onePath, fDirP->name[index] );
 302         strcat ( onePath, "/" );
 303         newFontPath[nPaths++] = onePath;
 304         /* printf ( "The path to be appended is %s\n", onePath ); */
 305       }
 306     }
 307 
 308     /*   printf ( "The dir count = %d\n", totalDirCount ); */
 309     free ( ( void *) appendDirList );




 269     /* if it fails free things and get out */
 270     if ( newFontPath == NULL ) {
 271       free ( ( void *) appendDirList );
 272       XFreeFontPath ( origFontPath );
 273       return;
 274     }
 275 
 276     for ( origIndex = 0; origIndex < nPaths; origIndex++ ) {
 277       onePath = origFontPath[origIndex];
 278       newFontPath[origIndex] = onePath;
 279     }
 280 
 281     /* now add the other font paths */
 282 
 283     for (index = 0; index < fDirP->num; index++ ) {
 284 
 285       if ( appendDirList[index] == 1 ) {
 286 
 287         /* printf ( "Appending %s\n", fDirP->name[index] ); */
 288 
 289         onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, (int)strlen (fDirP->name[index]) + 2, (int)sizeof( char ) );
 290         if (onePath == NULL) {
 291             free ( ( void *) appendDirList );
 292 
 293             for ( index = origIndex; index < nPaths; index++ ) {
 294                 free( newFontPath[index] );
 295             }
 296 
 297             free( ( void *) newFontPath);
 298             XFreeFontPath ( origFontPath );
 299             return;
 300         }
 301         strcpy ( onePath, fDirP->name[index] );
 302         strcat ( onePath, "/" );
 303         newFontPath[nPaths++] = onePath;
 304         /* printf ( "The path to be appended is %s\n", onePath ); */
 305       }
 306     }
 307 
 308     /*   printf ( "The dir count = %d\n", totalDirCount ); */
 309     free ( ( void *) appendDirList );


< prev index next >