comparison src/device-x.c @ 4404:80e07b006f9c

Prevent access to uninitialized variables in x_init_device. 2008-01-18 Jerry James <james@xemacs.org> * device-x.c (x_init_device): Don't write to path or read from format when neither has been initialized.
author Jerry James <james@xemacs.org>
date Fri, 18 Jan 2008 16:12:31 -0700
parents 229bd619740a
children e34711681f30
comparison
equal deleted inserted replaced
4403:7080e020d700 4404:80e07b006f9c
701 { 701 {
702 LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name); 702 LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name);
703 path = alloca_extbytes (strlen (data_dir) + 13 + strlen (locale) + 7); 703 path = alloca_extbytes (strlen (data_dir) + 13 + strlen (locale) + 7);
704 format = "%sapp-defaults/%s/Emacs"; 704 format = "%sapp-defaults/%s/Emacs";
705 } 705 }
706 else
707 {
708 goto no_data_directory;
709 }
706 710
707 /* 711 /*
708 * The general form for $LANG is <language>_<country>.<encoding>. Try 712 * The general form for $LANG is <language>_<country>.<encoding>. Try
709 * that form, <language>_<country> and <language> and load for first 713 * that form, <language>_<country> and <language> and load for first
710 * app-defaults file found. 714 * app-defaults file found.
728 732
729 if (!access (path, R_OK)) 733 if (!access (path, R_OK))
730 XrmCombineFileDatabase (path, &db, False); 734 XrmCombineFileDatabase (path, &db, False);
731 } 735 }
732 736
737 no_data_directory:
733 xfree (locale, Extbyte*); 738 xfree (locale, Extbyte*);
734 } 739 }
735 #endif /* MULE */ 740 #endif /* MULE */
736 741
737 if (NILP (DEVICE_NAME (d))) 742 if (NILP (DEVICE_NAME (d)))