Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 127723 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-27 / +20 lines)
Line  Link Here
0
-- fontforge/diffstubs.c
0
++ fontforge/diffstubs.c
Lines 1070-1081 return( dir = g_get_home_dir()); Link Here
1070
# include <pwd.h>
1070
# include <pwd.h>
1071
1071
1072
static char *gethomedir(void) {
1072
static char *gethomedir(void) {
1073
    static char *dir=NULL;
1073
    static char *dir;
1074
    int uid;
1074
    int uid;
1075
    struct passwd *pw;
1075
    struct passwd *pw;
1076
1076
1077
	dir = getenv("HOME");
1077
    if ( dir!=NULL )
1078
    if ( dir!=NULL )
1078
return( dir );
1079
return( strdup(dir) );
1079
1080
1080
    uid = getuid();
1081
    uid = getuid();
1081
    while ( (pw=getpwent())!=NULL ) {
1082
    while ( (pw=getpwent())!=NULL ) {
Lines 1087-1107 return( dir ); Link Here
1087
    }
1088
    }
1088
    endpwent();
1089
    endpwent();
1089
1090
1090
    if ( (dir=getenv("HOME"))!=NULL )
1091
return( (dir=strdup(dir)) );
1092
1093
return( NULL );
1091
return( NULL );
1094
}
1092
}
1095
#endif
1093
#endif
1096
1094
1097
char *getPfaEditDir(char *buffer) {
1095
char *getPfaEditDir(char *buffer) {
1098
    static char *dir=NULL;
1096
    char *dir=gethomedir();
1099
1097
1100
    if ( dir!=NULL )
1098
    if ( dir==NULL )
1101
return( dir );
1102
    if ( gethomedir()==NULL )
1103
return( NULL );
1099
return( NULL );
1104
    sprintf(buffer,"%s/.PfaEdit", gethomedir());
1100
    sprintf(buffer,"%s/.PfaEdit", dir);
1101
    free(dir);
1105
    if ( access(buffer,F_OK)==-1 )
1102
    if ( access(buffer,F_OK)==-1 )
1106
	if ( mkdir(buffer,0700)==-1 )
1103
	if ( mkdir(buffer,0700)==-1 )
1107
return( NULL );
1104
return( NULL );
1108
-- fontforge/autosave.c
1105
++ fontforge/autosave.c
Lines 48-59 return( dir = g_get_home_dir()); Link Here
48
# include <pwd.h>
48
# include <pwd.h>
49
49
50
static char *gethomedir(void) {
50
static char *gethomedir(void) {
51
    static char *dir=NULL;
51
    static char *dir;
52
    int uid;
52
    int uid;
53
    struct passwd *pw;
53
    struct passwd *pw;
54
54
55
	dir = getenv("HOME");
55
    if ( dir!=NULL )
56
    if ( dir!=NULL )
56
return( dir );
57
return( strdup(dir) );
57
58
58
    uid = getuid();
59
    uid = getuid();
59
    while ( (pw=getpwent())!=NULL ) {
60
    while ( (pw=getpwent())!=NULL ) {
Lines 65-85 return( dir ); Link Here
65
    }
66
    }
66
    endpwent();
67
    endpwent();
67
68
68
    if ( (dir=getenv("HOME"))!=NULL )
69
return( (dir=strdup(dir)) );
70
71
return( NULL );
69
return( NULL );
72
}
70
}
73
#endif
71
#endif
74
72
75
char *getPfaEditDir(char *buffer) {
73
char *getPfaEditDir(char *buffer) {
76
    static char *dir=NULL;
74
    char *dir=gethomedir();
77
75
78
    if ( dir!=NULL )
76
    if ( dir==NULL )
79
return( dir );
80
    if ( gethomedir()==NULL )
81
return( NULL );
77
return( NULL );
82
    sprintf(buffer,"%s/.PfaEdit", gethomedir());
78
    sprintf(buffer,"%s/.PfaEdit", dir);
79
    free(dir);
83
    if ( access(buffer,F_OK)==-1 )
80
    if ( access(buffer,F_OK)==-1 )
84
	if ( mkdir(buffer,0700)==-1 )
81
	if ( mkdir(buffer,0700)==-1 )
85
return( NULL );
82
return( NULL );
Lines 88-100 return( dir ); Link Here
88
}
85
}
89
86
90
static char *getAutoDirName(char *buffer) {
87
static char *getAutoDirName(char *buffer) {
91
    static char *dir=NULL;
88
    char *dir=getPfaEditDir(buffer);
92
89
93
    if ( dir!=NULL )
90
    if ( dir==NULL )
94
return( dir );
95
    if ( getPfaEditDir(buffer)==NULL )
96
return( NULL );
91
return( NULL );
97
    sprintf(buffer,"%s/autosave", getPfaEditDir(buffer));
92
    sprintf(buffer,"%s/autosave", dir);
93
    free(dir);
98
    if ( access(buffer,F_OK)==-1 )
94
    if ( access(buffer,F_OK)==-1 )
99
	if ( mkdir(buffer,0700)==-1 )
95
	if ( mkdir(buffer,0700)==-1 )
100
return( NULL );
96
return( NULL );

Return to bug 127723