Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
xosview
xosview-1.14-appdef.dif
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File xosview-1.14-appdef.dif of Package xosview
--- Xrm.cc +++ Xrm.cc 2013-04-09 10:07:23.161439587 +0000 @@ -9,6 +9,7 @@ #include <stdio.h> // For snprintf(). #include <ctype.h> #include <iostream> +#include <sys/stat.h> // For stat(). #include <unistd.h> // for access(), etc. BCG #ifndef NULL #define NULL 0 @@ -138,30 +139,34 @@ Listed from weakest to strongest: // Merge in the system resource database. char rfilename[2048]; + struct stat st; int result; const int rlen = sizeof rfilename; // Get the app-defaults + result = snprintf(rfilename, sizeof rfilename, "/usr/share/X11/app-defaults/%s", + XrmQuarkToString(_class)); + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) result = snprintf(rfilename, sizeof rfilename, "/etc/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < rlen) + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < rlen) + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/X11R6/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < rlen) + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); // Try a few more, for SunOS/Solaris folks. result = snprintf(rfilename, sizeof rfilename, "/usr/openwin/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < rlen) + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); result = snprintf(rfilename, sizeof rfilename, "/usr/local/X11R6/lib/X11/app-defaults/%s", XrmQuarkToString(_class)); - if (result >= 0 && result < rlen) + if (result >= 0 && result < rlen && stat(rfilename, &st) == 0) XrmCombineFileDatabase (rfilename, &_db, 1); // Now, check for an XOSView file in the XAPPLRESDIR directory...
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor