/[gentoo-x86]/net-ftp/pftpfxp/files/0.11.4.6-correct_config_fix.patch
Gentoo

Contents of /net-ftp/pftpfxp/files/0.11.4.6-correct_config_fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Fri Mar 16 16:48:39 2012 UTC (2 years, 9 months ago) by jer
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Fix bug #408231. Set RDEPEND. Move preparation stuff to src_prepare(). Respect LDFLAGS. Remove old patches. Do not automagically compile against dev-libs/openssl.

(Portage version: 2.2.0_alpha90/cvs/Linux x86_64)

1 --- pftpfxp-mew/src/main.cc.orig 2006-07-13 13:04:55.000000000 +1000
2 +++ pftpfxp-mew/src/main.cc 2006-07-13 13:07:35.000000000 +1000
3 @@ -547,7 +547,7 @@
4 if ((*label != '\0') && (strlen(value) > 0)) {
5 if (!strcasecmp(label, "DEVICE")) {
6 if (!DetermineOwnIP(value)) {
7 - printf("unknown network device '%s', sorry.\n",
8 + fprintf(stderr,"unknown network device '%s', sorry.\n",
9 value);
10 fclose(in_file);
11 return (FALSE);
12 @@ -705,7 +705,7 @@
13 strcpy(sectionlabels[21], value);
14 //debuglog("section22: %s", sectionlabels[21]);
15 } else {
16 - printf("unknown label '%s' in configfile.\n", label);
17 + fprintf(stderr,"unknown label '%s' in configfile.\n", label);
18 fclose(in_file);
19 return (FALSE);
20 }
21 @@ -1096,9 +1096,26 @@
22 }
23
24 int main(int argc, char **argv) {
25 - char msg[256], config_file[] = {".pftp/config"}, keymap_file[] = {".pftp/keymap"};
26 + char msg[256];
27 + char *home_directory;
28 + char *config_file;
29 + char *keymap_file;
30 int n;
31
32 + home_directory = getenv("HOME");
33 + n = strlen(home_directory) + sizeof("/.pftp/config") + 1;
34 + if ((config_file=(char*)malloc(n))==NULL) {
35 + fprintf(stderr,"error allocating memory\n");
36 + exit( -1);
37 + }
38 + if ((keymap_file=(char*)malloc(n))==NULL) {
39 + free(config_file);
40 + fprintf(stderr,"error allocating memory\n");
41 + exit( -1);
42 + }
43 + sprintf(config_file, "%s/.pftp/config", home_directory);
44 + sprintf(keymap_file, "%s/.pftp/keymap", home_directory);
45 +
46 pthread_mutex_init(&syscall_lock, NULL);
47 pthread_mutex_init(&sigwinch_lock, NULL);
48
49 @@ -1137,35 +1154,39 @@
50 getcwd(startcwd, SERVER_WORKINGDIR_SIZE);
51
52 if (!ReadConfig(config_file)) {
53 - printf("error reading/parsing configfile '%s', bailing out.\n", config_file);
54 + fprintf(stderr,"error reading/parsing configfile '%s', bailing out.\n", config_file);
55 + free(config_file);
56 exit( -1);
57 }
58 + free(config_file);
59
60 unlinklog();
61
62 if (!ReadKeymap(keymap_file)) {
63 - printf("error reading/parsing keymapfile '%s', bailing out.\n", keymap_file);
64 + fprintf(stderr,"error reading/parsing keymapfile '%s', bailing out.\n", keymap_file);
65 + free(keymap_file);
66 exit( -1);
67 }
68 + free(keymap_file);
69 debuglog("after keymap");
70
71 if (display->ProbeBookmarkRC() == 1) {
72 - printf("unknown or invalid bookmark file found, delete it\n");
73 + fprintf(stderr,"unknown or invalid bookmark file found, delete it\n");
74 exit( -1);
75 }
76
77 if (chdir(localdir) != 0) {
78 - printf("please specify a valid dir for the LOCALDIR label or comment it out\n");
79 + fprintf(stderr,"please specify a valid dir for the LOCALDIR label or comment it out\n");
80 exit ( -1);
81 }
82
83 if (!use_own_ip) {
84 - printf("you need to specify a network-device in the configfile.\n");
85 + fprintf(stderr,"you need to specify a network-device in the configfile.\n");
86 exit( -1);
87 }
88
89 if (!use_okay_dir) {
90 - printf("you need to specify a dir for the .okay and .error files in the configfile.\n");
91 + fprintf(stderr,"you need to specify a dir for the .okay and .error files in the configfile.\n");
92 exit( -1);
93 }
94

  ViewVC Help
Powered by ViewVC 1.1.20