< prev index next >

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

Print this page




 252                close ( dirFile );
 253                totalDirCount++;
 254                appendDirList[index] = 1;
 255             }
 256         }
 257 
 258     }
 259 
 260     /* if no changes are required do not bother to do a setfontpath */
 261     if ( totalDirCount == nPaths ) {
 262       free ( ( void *) appendDirList );
 263       XFreeFontPath ( origFontPath );
 264       return;
 265     }
 266 
 267 
 268     newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof ( char **) );
 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 );




 252                close ( dirFile );
 253                totalDirCount++;
 254                appendDirList[index] = 1;
 255             }
 256         }
 257 
 258     }
 259 
 260     /* if no changes are required do not bother to do a setfontpath */
 261     if ( totalDirCount == nPaths ) {
 262       free ( ( void *) appendDirList );
 263       XFreeFontPath ( origFontPath );
 264       return;
 265     }
 266 
 267 
 268     newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof ( char **) );
 269     /* if it fails free things and get out */
 270     if ( newFontPath == NULL ) {
 271       free ( ( void *) appendDirList );
 272       free((void*) newFontPath);
 273       XFreeFontPath ( origFontPath );
 274       return;
 275     }
 276 
 277     for ( origIndex = 0; origIndex < nPaths; origIndex++ ) {
 278       onePath = origFontPath[origIndex];
 279       newFontPath[origIndex] = onePath;
 280     }
 281 
 282     /* now add the other font paths */
 283 
 284     for (index = 0; index < fDirP->num; index++ ) {
 285 
 286       if ( appendDirList[index] == 1 ) {
 287 
 288         /* printf ( "Appending %s\n", fDirP->name[index] ); */
 289 
 290         onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) );
 291         if (onePath == NULL) {
 292             free ( ( void *) appendDirList );


< prev index next >