-
diff -urN mc-4.7.1_old/intl/localcharset.c mc-4.7.1_new/intl/localcharset.c
old
|
new
|
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | |
144 | | if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) |
| 144 | fp = fopen (file_name, "r"); |
| 145 | if (file_name == NULL || fp == NULL) |
145 | 146 | /* Out of memory or file not found, treat it as empty. */ |
146 | 147 | cp = ""; |
147 | 148 | else |
-
diff -urN mc-4.7.1_old/intl/plural.c mc-4.7.1_new/intl/plural.c
old
|
new
|
|
1532 | 1532 | case 12: |
1533 | 1533 | #line 195 "/srv/work/mc/git/intl/plural.y" |
1534 | 1534 | { |
1535 | | if (((yyval.exp) = new_exp_0 (num)) != NULL) |
| 1535 | yyval.exp = new_exp_0 (num); |
| 1536 | if (yyval.exp != NULL) |
1536 | 1537 | (yyval.exp)->val.num = (yyvsp[(1) - (1)].num); |
1537 | 1538 | } |
1538 | 1539 | break; |
-
diff -urN mc-4.7.1_old/lib/logging.c mc-4.7.1_new/lib/logging.c
old
|
new
|
|
67 | 67 | if (is_logging_enabled()) { |
68 | 68 | va_start(args, fmt); |
69 | 69 | logfilename = g_strdup_printf("%s/%s/log", home_dir, MC_USERCONF_DIR); |
70 | | if ((f = fopen(logfilename, "a")) != NULL) { |
| 70 | f = fopen (logfilename, "a"); |
| 71 | if (f != NULL) { |
71 | 72 | (void)vfprintf(f, fmt, args); |
72 | 73 | (void)fclose(f); |
73 | 74 | } |
-
diff -urN mc-4.7.1_old/lib/util.c mc-4.7.1_new/lib/util.c
old
|
new
|
|
519 | 519 | |
520 | 520 | if (has_prefix) |
521 | 521 | { |
522 | | if ((q = strstr (p, prefixes[i].name)) == 0) |
| 522 | q = strstr (p, prefixes[i].name); |
| 523 | if (q == NULL) |
523 | 524 | continue; |
524 | 525 | else |
525 | 526 | p = q + prefixes[i].len; |
526 | 527 | } |
527 | 528 | |
528 | | if ((dir = strchr (p, PATH_SEP)) != NULL) |
| 529 | dir = strchr (p, PATH_SEP); |
| 530 | if (dir != NULL) |
529 | 531 | *dir = '\0'; |
530 | 532 | |
531 | 533 | /* search for any possible user */ |
… |
… |
|
552 | 554 | size_t len; |
553 | 555 | static char newdir[MC_MAXPATHLEN]; |
554 | 556 | |
555 | | if (home_dir && !strncmp (dir, home_dir, len = strlen (home_dir)) && |
| 557 | len = strlen (home_dir); |
| 558 | if (home_dir && !strncmp (dir, home_dir, len) && |
556 | 559 | (dir[len] == PATH_SEP || dir[len] == '\0')) |
557 | 560 | { |
558 | 561 | newdir[0] = '~'; |
… |
… |
|
612 | 615 | char *data; |
613 | 616 | long read_size; |
614 | 617 | |
615 | | if ((data_file = fopen (filename, "r")) == NULL) |
| 618 | data_file = fopen (filename, "r"); |
| 619 | if (data_file == NULL) |
616 | 620 | { |
617 | 621 | return 0; |
618 | 622 | } |
-
diff -urN mc-4.7.1_old/lib/utilunix.c mc-4.7.1_new/lib/utilunix.c
old
|
new
|
|
91 | 91 | char *name; |
92 | 92 | static int uid_last; |
93 | 93 | |
94 | | if ((name = i_cache_match (uid, uid_cache, UID_CACHE_SIZE)) != NULL) |
| 94 | name = i_cache_match (uid, uid_cache, UID_CACHE_SIZE); |
| 95 | if (name != NULL) |
95 | 96 | return name; |
96 | 97 | |
97 | 98 | pwd = getpwuid (uid); |
… |
… |
|
112 | 113 | char *name; |
113 | 114 | static int gid_last; |
114 | 115 | |
115 | | if ((name = i_cache_match (gid, gid_cache, GID_CACHE_SIZE)) != NULL) |
| 116 | name = i_cache_match (gid, gid_cache, GID_CACHE_SIZE); |
| 117 | if (name != NULL) |
116 | 118 | return name; |
117 | 119 | |
118 | 120 | grp = getgrgid (gid); |
… |
… |
|
150 | 152 | /* handler messing the screen after the SIGCONT */ |
151 | 153 | sigaction (SIGTSTP, &startup_handler, &save_stop); |
152 | 154 | |
153 | | if ((pid = fork ()) < 0){ |
| 155 | pid = fork (); |
| 156 | if (pid < 0) { |
154 | 157 | fprintf (stderr, "\n\nfork () = -1\n"); |
155 | 158 | return -1; |
156 | | } |
157 | | if (pid == 0){ |
| 159 | } else if (pid == 0) { |
158 | 160 | signal (SIGINT, SIG_DFL); |
159 | 161 | signal (SIGQUIT, SIG_DFL); |
160 | 162 | signal (SIGTSTP, SIG_DFL); |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/cpio.c mc-4.7.1_new/lib/vfs/mc-vfs/cpio.c
old
|
new
|
|
165 | 165 | mode_t mode; |
166 | 166 | struct vfs_s_inode *root; |
167 | 167 | |
168 | | if ((fd = mc_open (name, O_RDONLY)) == -1) { |
| 168 | fd = mc_open (name, O_RDONLY); |
| 169 | if (fd == -1) { |
169 | 170 | message (D_ERROR, MSG_ERROR, _("Cannot open cpio archive\n%s"), name); |
170 | 171 | return -1; |
171 | 172 | } |
… |
… |
|
181 | 182 | |
182 | 183 | mc_close (fd); |
183 | 184 | s = g_strconcat (name, decompress_extension (type), (char *) NULL); |
184 | | if ((fd = mc_open (s, O_RDONLY)) == -1) { |
| 185 | fd = mc_open (s, O_RDONLY); |
| 186 | if (fd == -1) { |
185 | 187 | message (D_ERROR, MSG_ERROR, _("Cannot open cpio archive\n%s"), s); |
186 | 188 | g_free (s); |
187 | 189 | return -1; |
… |
… |
|
247 | 249 | ptr -= top - 128; |
248 | 250 | top = 128; |
249 | 251 | } |
250 | | if((tmp = mc_read(super->u.arch.fd, buf, top)) == 0 || tmp == -1) { |
| 252 | tmp = mc_read(super->u.arch.fd, buf, top); |
| 253 | if (tmp == 0 || tmp == -1) { |
251 | 254 | message (D_ERROR, MSG_ERROR, _("Premature end of cpio archive\n%s"), super->name); |
252 | 255 | cpio_free_archive(me, super); |
253 | 256 | return CPIO_UNKNOWN; |
… |
… |
|
419 | 422 | char *name; |
420 | 423 | struct stat st; |
421 | 424 | |
422 | | if((len = mc_read(super->u.arch.fd, (char *)&u.buf, HEAD_LENGTH)) < HEAD_LENGTH) |
| 425 | len = mc_read (super->u.arch.fd, (char *)&u.buf, HEAD_LENGTH); |
| 426 | if (len < HEAD_LENGTH) |
423 | 427 | return STATUS_EOF; |
424 | 428 | CPIO_POS(super) += len; |
425 | 429 | if(super->u.arch.type == CPIO_BINRE) { |
… |
… |
|
435 | 439 | return STATUS_FAIL; |
436 | 440 | } |
437 | 441 | name = g_malloc(u.buf.c_namesize); |
438 | | if((len = mc_read(super->u.arch.fd, name, u.buf.c_namesize)) < u.buf.c_namesize) { |
| 442 | len = mc_read (super->u.arch.fd, name, u.buf.c_namesize); |
| 443 | if (len < u.buf.c_namesize) { |
439 | 444 | g_free(name); |
440 | 445 | return STATUS_EOF; |
441 | 446 | } |
… |
… |
|
493 | 498 | return STATUS_FAIL; |
494 | 499 | } |
495 | 500 | name = g_malloc(hd.c_namesize); |
496 | | if((len = mc_read(super->u.arch.fd, name, hd.c_namesize)) == -1 || |
497 | | (unsigned long) len < hd.c_namesize) { |
| 501 | len = mc_read (super->u.arch.fd, name, hd.c_namesize); |
| 502 | if ((len == -1) || ((unsigned long) len < hd.c_namesize)) { |
498 | 503 | g_free (name); |
499 | 504 | return STATUS_EOF; |
500 | 505 | } |
… |
… |
|
669 | 674 | |
670 | 675 | count = MIN(count, FH->ino->st.st_size - FH->pos); |
671 | 676 | |
672 | | if ((count = mc_read (fd, buffer, count)) == -1) ERRNOR (errno, -1); |
| 677 | count = mc_read (fd, buffer, count); |
| 678 | if (count == -1) |
| 679 | ERRNOR (errno, -1); |
673 | 680 | |
674 | 681 | FH->pos += count; |
675 | 682 | return count; |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/direntry.c mc-4.7.1_new/lib/vfs/mc-vfs/direntry.c
old
|
new
|
|
485 | 485 | vfs_split (inname, &local, &op); |
486 | 486 | retval = (local) ? local : ""; |
487 | 487 | |
488 | | if (MEDATA->archive_check) |
489 | | if (!(cookie = MEDATA->archive_check (me, archive_name, op))) |
| 488 | if (MEDATA->archive_check) { |
| 489 | cookie = MEDATA->archive_check (me, archive_name, op); |
| 490 | if (cookie == NULL) |
490 | 491 | return NULL; |
| 492 | } |
491 | 493 | |
492 | 494 | for (super = MEDATA->supers; super != NULL; super = super->next) { |
493 | 495 | /* 0 == other, 1 == same, return it, 2 == other but stop scanning */ |
… |
… |
|
587 | 589 | struct vfs_s_inode *ino; |
588 | 590 | char *q; |
589 | 591 | |
590 | | if (!(q = vfs_s_get_path (me, name, &super, 0))) |
| 592 | q = vfs_s_get_path (me, name, &super, 0); |
| 593 | if (q == NULL) |
591 | 594 | return NULL; |
592 | 595 | |
593 | 596 | ino = |
… |
… |
|
670 | 673 | vfs_s_chdir (struct vfs_class *me, const char *path) |
671 | 674 | { |
672 | 675 | void *data; |
673 | | if (!(data = vfs_s_opendir (me, path))) |
| 676 | |
| 677 | data = vfs_s_opendir (me, path); |
| 678 | if (data == NULL) |
674 | 679 | return -1; |
| 680 | |
675 | 681 | vfs_s_closedir (data); |
676 | 682 | return 0; |
677 | 683 | } |
… |
… |
|
683 | 689 | { |
684 | 690 | struct vfs_s_inode *ino; |
685 | 691 | |
686 | | if (!(ino = vfs_s_inode_from_path (me, path, flag))) |
| 692 | ino = vfs_s_inode_from_path (me, path, flag); |
| 693 | if (ino == NULL) |
687 | 694 | return -1; |
| 695 | |
688 | 696 | *buf = ino->st; |
689 | 697 | return 0; |
690 | 698 | } |
… |
… |
|
741 | 749 | char *q; |
742 | 750 | struct vfs_s_inode *ino; |
743 | 751 | |
744 | | if ((q = vfs_s_get_path (me, file, &super, 0)) == NULL) |
| 752 | q = vfs_s_get_path (me, file, &super, 0); |
| 753 | if (q == NULL) |
745 | 754 | return NULL; |
746 | 755 | ino = vfs_s_find_inode (me, super, q, LINK_FOLLOW, FL_NONE); |
747 | 756 | if (ino && ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))) { |
… |
… |
|
1105 | 1114 | struct vfs_s_super *archive; |
1106 | 1115 | char *p; |
1107 | 1116 | |
1108 | | if (!(p = vfs_s_get_path (me, path, &archive, FL_NO_OPEN))) |
| 1117 | p = vfs_s_get_path (me, path, &archive, FL_NO_OPEN); |
| 1118 | if (p == NULL) |
1109 | 1119 | return NULL; |
| 1120 | |
1110 | 1121 | g_free(p); |
1111 | 1122 | return (vfsid) archive; |
1112 | 1123 | } |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/fish.c mc-4.7.1_new/lib/vfs/mc-vfs/fish.c
old
|
new
|
|
197 | 197 | if ((pipe(fileset1)<0) || (pipe(fileset2)<0)) |
198 | 198 | vfs_die("Cannot pipe(): %m."); |
199 | 199 | |
200 | | if ((res = fork())) { |
201 | | if (res<0) vfs_die("Cannot fork(): %m."); |
| 200 | res = fork(); |
| 201 | if (res < 0) { |
| 202 | vfs_die("Cannot fork(): %m."); |
| 203 | } else if (res > 0) { |
202 | 204 | /* We are the parent */ |
203 | 205 | close(fileset1[0]); |
204 | 206 | SUP.sockw = fileset1[1]; |
… |
… |
|
785 | 787 | } |
786 | 788 | if (n == 0) |
787 | 789 | break; |
788 | | if ((t = write (SUP.sockw, buffer, n)) != n) { |
| 790 | |
| 791 | t = write (SUP.sockw, buffer, n); |
| 792 | if (t != n) { |
789 | 793 | if (t == -1) { |
790 | 794 | me->verrno = errno; |
791 | 795 | } else { |
… |
… |
|
871 | 875 | do { |
872 | 876 | n = MIN(8192, fh->u.fish.total - fh->u.fish.got); |
873 | 877 | if (n) { |
874 | | if ((n = read(SUP.sockr, buffer, n)) < 0) |
| 878 | n = read(SUP.sockr, buffer, n); |
| 879 | if (n < 0) |
875 | 880 | return; |
| 881 | |
876 | 882 | fh->u.fish.got += n; |
877 | 883 | } |
878 | 884 | } while (n); |
… |
… |
|
897 | 903 | } |
898 | 904 | tty_enable_interrupt_key(); |
899 | 905 | |
900 | | if (n>0) fh->u.fish.got += n; |
901 | | if (n<0) fish_linear_abort(me, fh); |
902 | | if ((!n) && ((fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE))) |
| 906 | if (n > 0) |
| 907 | fh->u.fish.got += n; |
| 908 | else if (n < 0) |
| 909 | fish_linear_abort (me, fh); |
| 910 | else if (fish_get_reply (me, SUP.sockr, NULL, 0) != COMPLETE) |
903 | 911 | ERRNOR (E_REMOTE, -1); |
| 912 | |
904 | 913 | ERRNOR (errno, n); |
905 | 914 | } |
906 | 915 | |
… |
… |
|
958 | 967 | const char *crpath; \ |
959 | 968 | char *rpath, *mpath = g_strdup (path); \ |
960 | 969 | struct vfs_s_super *super; \ |
961 | | if (!(crpath = vfs_s_get_path_mangle (me, mpath, &super, 0))) { \ |
| 970 | crpath = vfs_s_get_path_mangle (me, mpath, &super, 0); \ |
| 971 | if (crpath == NULL) { \ |
962 | 972 | g_free (mpath); \ |
963 | 973 | return -1; \ |
964 | 974 | } \ |
… |
… |
|
991 | 1001 | const char *crpath1, *crpath2; \ |
992 | 1002 | char *rpath1, *rpath2, *mpath1, *mpath2; \ |
993 | 1003 | struct vfs_s_super *super1, *super2; \ |
994 | | if (!(crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0))) { \ |
| 1004 | crpath1 = vfs_s_get_path_mangle (me, mpath1 = g_strdup(path1), &super1, 0); \ |
| 1005 | if (crpath1 == NULL) { \ |
995 | 1006 | g_free (mpath1); \ |
996 | 1007 | return -1; \ |
997 | 1008 | } \ |
998 | | if (!(crpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0))) { \ |
| 1009 | crpath2 = vfs_s_get_path_mangle (me, mpath2 = g_strdup(path2), &super2, 0); \ |
| 1010 | if (crpath2 == NULL) { \ |
999 | 1011 | g_free (mpath1); \ |
1000 | 1012 | g_free (mpath2); \ |
1001 | 1013 | return -1; \ |
… |
… |
|
1047 | 1059 | struct passwd *pw; |
1048 | 1060 | struct group *gr; |
1049 | 1061 | |
1050 | | if ((pw = getpwuid (owner)) == NULL) |
| 1062 | pw = getpwuid (owner); |
| 1063 | if (pw == NULL) |
1051 | 1064 | return 0; |
1052 | 1065 | |
1053 | | if ((gr = getgrgid (group)) == NULL) |
| 1066 | gr = getgrgid (group); |
| 1067 | if (gr == NULL) |
1054 | 1068 | return 0; |
1055 | 1069 | |
1056 | 1070 | sowner = pw->pw_name; |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/ftpfs.c mc-4.7.1_new/lib/vfs/mc-vfs/ftpfs.c
old
|
new
|
|
223 | 223 | memmove (p + 1, p + 2, strlen (p + 2) + 1); |
224 | 224 | |
225 | 225 | /* strip trailing "/." */ |
226 | | if ((p = strrchr (ret, '/')) && *(p + 1) == '.' && *(p + 2) == '\0') |
| 226 | p = strrchr (ret, '/'); |
| 227 | if ((p != NULL) && (*(p + 1) == '.') && (*(p + 2) == '\0')) |
227 | 228 | *p = '\0'; |
| 229 | |
228 | 230 | return ret; |
229 | 231 | } |
230 | 232 | } |
… |
… |
|
580 | 582 | return; |
581 | 583 | |
582 | 584 | mc_file = concat_dir_and_file (mc_home, "mc.no_proxy"); |
583 | | if (exist_file (mc_file) && |
584 | | (npf = fopen (mc_file, "r"))) { |
585 | | while (fgets (s, sizeof (s), npf)) { |
586 | | if (!(p = strchr (s, '\n'))) { /* skip bogus entries */ |
587 | | while ((c = fgetc (npf)) != EOF && c != '\n') |
588 | | ; |
589 | | continue; |
590 | | } |
591 | | |
592 | | if (p == s) |
593 | | continue; |
594 | | |
595 | | *p = '\0'; |
596 | | |
597 | | np = g_new (struct no_proxy_entry, 1); |
598 | | np->domain = g_strdup (s); |
599 | | np->next = NULL; |
600 | | if (no_proxy) |
601 | | current->next = np; |
602 | | else |
603 | | no_proxy = np; |
604 | | current = np; |
605 | | } |
606 | | |
607 | | fclose (npf); |
| 585 | if (exist_file (mc_file)) { |
| 586 | npf = fopen (mc_file, "r"); |
| 587 | if (npf != NULL) { |
| 588 | while (fgets (s, sizeof (s), npf)) { |
| 589 | p = strchr (s, '\n'); |
| 590 | if (p == NULL) { /* skip bogus entries */ |
| 591 | while ((c = fgetc (npf)) != EOF && c != '\n') |
| 592 | ; |
| 593 | continue; |
| 594 | } |
| 595 | |
| 596 | if (p == s) |
| 597 | continue; |
| 598 | |
| 599 | *p = '\0'; |
| 600 | |
| 601 | np = g_new (struct no_proxy_entry, 1); |
| 602 | np->domain = g_strdup (s); |
| 603 | np->next = NULL; |
| 604 | if (no_proxy) |
| 605 | current->next = np; |
| 606 | else |
| 607 | no_proxy = np; |
| 608 | current = np; |
| 609 | } |
| 610 | fclose (npf); |
| 611 | } |
608 | 612 | } |
609 | 613 | g_free (mc_file); |
610 | 614 | } |
… |
… |
|
1093 | 1097 | int s, j, data; |
1094 | 1098 | socklen_t fromlen = sizeof(from); |
1095 | 1099 | |
1096 | | if ((s = ftpfs_initconn (me, super)) == -1) |
| 1100 | s = ftpfs_initconn (me, super); |
| 1101 | if (s == -1) |
1097 | 1102 | return -1; |
| 1103 | |
1098 | 1104 | if (ftpfs_changetype (me, super, isbinary) == -1) |
1099 | 1105 | return -1; |
| 1106 | |
1100 | 1107 | if (reget > 0){ |
1101 | 1108 | j = ftpfs_command (me, super, WAIT_REPLY, "REST %d", reget); |
1102 | 1109 | if (j != CONTINUE) |
… |
… |
|
1622 | 1629 | int r; |
1623 | 1630 | int flush_directory_cache = (flags & OPT_FLUSH); |
1624 | 1631 | |
1625 | | if (!(rpath = vfs_s_get_path_mangle(me, mpath, &super, 0))) { |
1626 | | g_free(mpath); |
| 1632 | rpath = vfs_s_get_path_mangle (me, mpath, &super, 0); |
| 1633 | if (rpath == NULL) { |
| 1634 | g_free (mpath); |
1627 | 1635 | return -1; |
1628 | 1636 | } |
1629 | 1637 | p = ftpfs_translate_path (me, super, rpath); |
… |
… |
|
1632 | 1640 | vfs_stamp_create (&vfs_ftpfs_ops, super); |
1633 | 1641 | if (flags & OPT_IGNORE_ERROR) |
1634 | 1642 | r = COMPLETE; |
| 1643 | |
1635 | 1644 | if (r != COMPLETE) { |
1636 | 1645 | me->verrno = EPERM; |
1637 | 1646 | g_free (mpath); |
… |
… |
|
2048 | 2057 | /* Find our own domain name */ |
2049 | 2058 | if (gethostname (hostname, sizeof (hostname)) < 0) |
2050 | 2059 | *hostname = 0; |
2051 | | if (!(domain = strchr (hostname, '.'))) |
| 2060 | |
| 2061 | domain = strchr (hostname, '.'); |
| 2062 | if (domain == NULL) |
2052 | 2063 | domain = ""; |
2053 | 2064 | |
2054 | 2065 | /* Scan for "default" and matching "machine" keywords */ |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/mcfs.c mc-4.7.1_new/lib/vfs/mc-vfs/mcfs.c
old
|
new
|
|
212 | 212 | #ifdef HAVE_PMAP_GETPORT |
213 | 213 | int port; |
214 | 214 | for (*version = RPC_PROGVER; *version >= 1; (*version)--) |
215 | | if (port = pmap_getport (sin, RPC_PROGNUM, *version, IPPROTO_TCP)) |
| 215 | port = pmap_getport (sin, RPC_PROGNUM, *version, IPPROTO_TCP); |
| 216 | if (port != NULL) |
216 | 217 | return port; |
217 | 218 | #endif /* HAVE_PMAP_GETPORT */ |
218 | 219 | *version = 1; |
… |
… |
|
237 | 238 | server_address.sin_family = AF_INET; |
238 | 239 | |
239 | 240 | /* Try to use the dotted decimal number */ |
240 | | if ((inaddr = inet_addr (host)) != INADDR_NONE) |
| 241 | inaddr = inet_addr (host); |
| 242 | if (inaddr != INADDR_NONE) { |
241 | 243 | memcpy ((char *) &server_address.sin_addr, (char *) &inaddr, |
242 | 244 | sizeof (inaddr)); |
243 | | else { |
244 | | if ((hp = gethostbyname (host)) == NULL) { |
| 245 | } else { |
| 246 | hp = gethostbyname (host); |
| 247 | if (hp == NULL) { |
245 | 248 | message (D_ERROR, caller, _(" Cannot locate hostname: %s "), |
246 | 249 | host); |
247 | 250 | return 0; |
… |
… |
|
259 | 262 | *version = 1; |
260 | 263 | |
261 | 264 | server_address.sin_port = htons (*port); |
262 | | |
263 | | if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) { |
| 265 | my_socket = socket (AF_INET, SOCK_STREAM, 0); |
| 266 | if (my_socket < 0) { |
264 | 267 | message (D_ERROR, caller, _(" Cannot create socket: %s "), |
265 | 268 | unix_error_string (errno)); |
266 | 269 | return 0; |
… |
… |
|
340 | 343 | message (D_ERROR, MSG_ERROR, _(" Too many open connections ")); |
341 | 344 | return 0; |
342 | 345 | } |
343 | | |
344 | | if (! |
345 | | (sock = |
346 | | mcfs_open_tcp_link (host, user, port, netrcpass, &version))) |
| 346 | sock = mcfs_open_tcp_link (host, user, port, netrcpass, &version); |
| 347 | if (sock == 0) |
347 | 348 | return 0; |
348 | 349 | |
349 | 350 | bucket = mcfs_get_free_bucket (); |
… |
… |
|
394 | 395 | * remote portmapper to get the port number |
395 | 396 | */ |
396 | 397 | port = 0; |
397 | | if ((remote_path = |
398 | | mcfs_get_host_and_username (path, &host, &user, &port, &pass))) |
399 | | if (!(*mc = mcfs_open_link (host, user, &port, pass))) { |
| 398 | remote_path = mcfs_get_host_and_username (path, &host, &user, &port, &pass); |
| 399 | if (remote_path != NULL) { |
| 400 | *mc = mcfs_open_link (host, user, &port, pass); |
| 401 | if (*mc == NULL) { |
400 | 402 | g_free (remote_path); |
401 | 403 | remote_path = NULL; |
402 | 404 | } |
| 405 | } |
403 | 406 | g_free (host); |
404 | 407 | g_free (user); |
405 | 408 | if (pass) |
… |
… |
|
445 | 448 | mcfs_connection *mc; |
446 | 449 | char *r1, *r2; |
447 | 450 | |
448 | | if ((r1 = mcfs_get_path (&mc, s1)) == 0) |
| 451 | r1 = mcfs_get_path (&mc, s1); |
| 452 | if (r1 == NULL) |
449 | 453 | return -1; |
450 | 454 | |
451 | | if ((r2 = mcfs_get_path (&mc, s2)) == 0) { |
| 455 | r2 = mcfs_get_path (&mc, s2); |
| 456 | if (r2 == NULL) { |
452 | 457 | g_free (r1); |
453 | 458 | return -1; |
454 | 459 | } |
… |
… |
|
466 | 471 | mcfs_connection *mc; |
467 | 472 | char *remote_file; |
468 | 473 | |
469 | | if ((remote_file = mcfs_get_path (&mc, path)) == 0) |
| 474 | remote_file = mcfs_get_path (&mc, path); |
| 475 | if (remote_file == NULL) |
470 | 476 | return -1; |
471 | 477 | |
472 | 478 | rpc_send (mc->sock, |
… |
… |
|
482 | 488 | mcfs_connection *mc; |
483 | 489 | char *remote_file; |
484 | 490 | |
485 | | if ((remote_file = mcfs_get_path (&mc, path)) == 0) |
| 491 | remote_file = mcfs_get_path (&mc, path); |
| 492 | if (remote_file == NULL) |
486 | 493 | return -1; |
487 | 494 | |
488 | 495 | rpc_send (mc->sock, |
… |
… |
|
499 | 506 | mcfs_connection *mc; |
500 | 507 | char *remote_file; |
501 | 508 | |
502 | | if ((remote_file = mcfs_get_path (&mc, path)) == 0) |
| 509 | remote_file = mcfs_get_path (&mc, path); |
| 510 | if (remote_file == NULL) |
503 | 511 | return -1; |
504 | 512 | |
505 | 513 | rpc_send (mc->sock, |
… |
… |
|
537 | 545 | |
538 | 546 | (void) me; |
539 | 547 | |
540 | | if (!(remote_file = mcfs_get_path (&mc, file))) |
| 548 | remote_file = mcfs_get_path (&mc, file); |
| 549 | if (remote_file == NULL) |
541 | 550 | return 0; |
542 | 551 | |
543 | 552 | rpc_send (mc->sock, RPC_INT, MC_OPEN, RPC_STRING, remote_file, RPC_INT, |
… |
… |
|
661 | 670 | |
662 | 671 | (void) me; |
663 | 672 | |
664 | | if (!(remote_dir = mcfs_get_path (&mc, dirname))) |
665 | | return 0; |
| 673 | remote_dir = mcfs_get_path (&mc, dirname); |
| 674 | if (remote_dir == NULL) |
| 675 | return NULL; |
666 | 676 | |
667 | 677 | rpc_send (mc->sock, RPC_INT, MC_OPENDIR, RPC_STRING, remote_dir, |
668 | 678 | RPC_END); |
… |
… |
|
670 | 680 | |
671 | 681 | if (0 == |
672 | 682 | rpc_get (mc->sock, RPC_INT, &result, RPC_INT, &error_num, RPC_END)) |
673 | | return 0; |
| 683 | return NULL; |
674 | 684 | |
675 | 685 | if (mcfs_is_error (result, error_num)) |
676 | | return 0; |
| 686 | return NULL; |
677 | 687 | |
678 | 688 | handle = result; |
679 | 689 | |
… |
… |
|
683 | 693 | mcfs_info->entries = 0; |
684 | 694 | mcfs_info->current = 0; |
685 | 695 | |
686 | | return mcfs_info; |
| 696 | return (void *) mcfs_info; |
687 | 697 | } |
688 | 698 | |
689 | 699 | static int mcfs_get_stat_info (mcfs_connection * mc, struct stat *buf); |
… |
… |
|
880 | 890 | mcfs_connection *mc; |
881 | 891 | int status, error; |
882 | 892 | |
883 | | if ((remote_file = mcfs_get_path (&mc, path)) == 0) |
| 893 | remote_file = mcfs_get_path (&mc, path); |
| 894 | if (remote_file == NULL) |
884 | 895 | return -1; |
885 | 896 | |
886 | 897 | rpc_send (mc->sock, RPC_INT, cmd, RPC_STRING, remote_file, RPC_END); |
… |
… |
|
970 | 981 | |
971 | 982 | (void) me; |
972 | 983 | |
973 | | if (!(file = mcfs_get_path (&mc, path))) |
| 984 | remote_file = mcfs_get_path (&mc, path); |
| 985 | if (remote_file == NULL) |
974 | 986 | return -1; |
975 | 987 | |
976 | 988 | status = 0; |
… |
… |
|
1005 | 1017 | |
1006 | 1018 | (void) me; |
1007 | 1019 | |
1008 | | if (!(remote_file = mcfs_get_path (&mc, path))) |
| 1020 | remote_file = mcfs_get_path (&mc, path); |
| 1021 | if (remote_file == NULL) |
1009 | 1022 | return -1; |
1010 | 1023 | |
1011 | 1024 | rpc_send (mc->sock, RPC_INT, MC_READLINK, RPC_STRING, remote_file, |
… |
… |
|
1062 | 1075 | |
1063 | 1076 | (void) me; |
1064 | 1077 | |
1065 | | if (!(remote_dir = mcfs_get_path (&mc, path))) |
| 1078 | remote_file = mcfs_get_path (&mc, path); |
| 1079 | if (remote_file == NULL) |
1066 | 1080 | return -1; |
1067 | 1081 | |
1068 | 1082 | rpc_send (mc->sock, RPC_INT, MC_CHDIR, RPC_STRING, remote_dir, |
… |
… |
|
1137 | 1151 | return; |
1138 | 1152 | |
1139 | 1153 | path += 5; |
1140 | | if (path[0] == '/' && path[1] == '/') |
| 1154 | if ((path[0] == '/') && (path[1] == '/')) |
1141 | 1155 | path += 2; |
1142 | 1156 | |
1143 | | if ((p = |
1144 | | mcfs_get_host_and_username (path, &host, &user, &port, |
1145 | | &pass)) == 0) { |
| 1157 | p = mcfs_get_host_and_username (path, &host, &user, &port, &pass); |
| 1158 | if (p == NULL) { |
1146 | 1159 | g_free (host); |
1147 | 1160 | g_free (user); |
1148 | 1161 | if (pass) |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/mcserv.c mc-4.7.1_new/lib/vfs/mc-vfs/mcserv.c
old
|
new
|
|
799 | 799 | up.password = password; |
800 | 800 | conv.appdata_ptr = &up; |
801 | 801 | |
802 | | if ((status = |
803 | | pam_start ("mcserv", username, &conv, &pamh)) != PAM_SUCCESS) |
| 802 | status = pam_start ("mcserv", username, &conv, &pamh); |
| 803 | if (status != PAM_SUCCESS) |
804 | 804 | goto failed_pam; |
805 | | if ((status = pam_authenticate (pamh, 0)) != PAM_SUCCESS) |
| 805 | |
| 806 | status = pam_authenticate (pamh, 0); |
| 807 | if (status != PAM_SUCCESS) |
806 | 808 | goto failed_pam; |
807 | | if ((status = pam_acct_mgmt (pamh, 0)) != PAM_SUCCESS) |
| 809 | |
| 810 | status = pam_acct_mgmt (pamh, 0); |
| 811 | if (status != PAM_SUCCESS) |
808 | 812 | goto failed_pam; |
809 | | if ((status = pam_setcred (pamh, PAM_ESTABLISH_CRED)) != PAM_SUCCESS) |
| 813 | |
| 814 | status = pam_setcred (pamh, PAM_ESTABLISH_CRED); |
| 815 | if (status != PAM_SUCCESS) |
810 | 816 | goto failed_pam; |
| 817 | |
811 | 818 | pam_end (pamh, status); |
812 | 819 | return 0; |
813 | 820 | |
… |
… |
|
866 | 873 | local_address.sin_port = htons (21); |
867 | 874 | |
868 | 875 | /* Convert localhost to usable format */ |
869 | | if ((inaddr = inet_addr ("127.0.0.1")) != INADDR_NONE) |
| 876 | inaddr = inet_addr ("127.0.0.1"); |
| 877 | if (inaddr != INADDR_NONE) |
870 | 878 | memcpy ((char *) &local_address.sin_addr, (char *) &inaddr, |
871 | 879 | sizeof (inaddr)); |
872 | 880 | |
873 | | if ((my_socket = socket (AF_INET, SOCK_STREAM, 0)) < 0) { |
| 881 | my_socket = socket (AF_INET, SOCK_STREAM, 0); |
| 882 | if (my_socket < 0) { |
874 | 883 | if (!isDaemon) |
875 | 884 | fprintf (stderr, "do_auth: can't create socket\n"); |
876 | 885 | return 0; |
… |
… |
|
916 | 925 | struct spwd *spw; |
917 | 926 | #endif |
918 | 927 | |
919 | | if ((pw = getpwnam (username)) == 0) |
| 928 | pw = getpwnam (username); |
| 929 | if (pw == NULL) |
920 | 930 | return 0; |
921 | 931 | |
922 | 932 | #ifdef HAVE_SHADOW |
923 | 933 | setspent (); |
924 | 934 | |
925 | 935 | /* Password expiration is not checked! */ |
926 | | if ((spw = getspnam (username)) == NULL) |
| 936 | spw = getspnam (username); |
| 937 | if (spw == NULL) |
927 | 938 | encr_pwd = "*"; |
928 | 939 | else |
929 | 940 | encr_pwd = spw->sp_pwdp; |
… |
… |
|
1200 | 1211 | struct sockaddr_in client_address, server_address; |
1201 | 1212 | int yes = 1; |
1202 | 1213 | |
1203 | | if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) |
| 1214 | sock = socket (AF_INET, SOCK_STREAM, 0); |
| 1215 | if (sock < 0) |
1204 | 1216 | return "Cannot create socket"; |
1205 | 1217 | |
1206 | 1218 | /* Use this to debug: */ |
… |
… |
|
1227 | 1239 | newsocket = |
1228 | 1240 | accept (sock, (struct sockaddr *) &client_address, &clilen); |
1229 | 1241 | |
1230 | | if (isDaemon && (child = fork ())) { |
| 1242 | child = fork (); |
| 1243 | if (isDaemon && child) { |
1231 | 1244 | int status; |
1232 | 1245 | |
1233 | 1246 | close (newsocket); |
… |
… |
|
1373 | 1386 | register_port (portnum, 0); |
1374 | 1387 | if (verbose) |
1375 | 1388 | printf ("Using port %d\n", portnum); |
1376 | | if ((result = get_client (portnum))) |
| 1389 | |
| 1390 | result = get_client (portnum); |
| 1391 | if (result != NULL) |
1377 | 1392 | perror (result); |
1378 | 1393 | #ifdef HAVE_PMAP_SET |
1379 | | if (!isDaemon) |
| 1394 | if (isDaemon == NULL) |
1380 | 1395 | pmap_unset (RPC_PROGNUM, RPC_PROGVER); |
1381 | 1396 | #endif |
1382 | 1397 | } |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/sfs.c mc-4.7.1_new/lib/vfs/mc-vfs/sfs.c
old
|
new
|
|
84 | 84 | |
85 | 85 | pname = g_strdup (name); |
86 | 86 | vfs_split (pname, &inpath, &op); |
87 | | if ((w = (*me->which) (me, op)) == -1) |
| 87 | w = (*me->which) (me, op); |
| 88 | if (w == -1) |
88 | 89 | vfs_die ("This cannot happen... Hopefully.\n"); |
89 | 90 | |
90 | 91 | if (!(sfs_flags[w] & F_1) && strcmp (pname, "/")) { |
… |
… |
|
392 | 393 | } |
393 | 394 | if (!*c) |
394 | 395 | goto invalid_line; |
| 396 | |
395 | 397 | c++; |
396 | 398 | *(semi+1) = 0; |
397 | | if ((semi = strchr (c, '\n'))) |
| 399 | semi = strchr (c, '\n'); |
| 400 | if (semi != NULL) |
398 | 401 | *semi = 0; |
399 | 402 | |
400 | 403 | sfs_prefix [sfs_no] = g_strdup (key); |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/tar.c mc-4.7.1_new/lib/vfs/mc-vfs/tar.c
old
|
new
|
|
666 | 666 | |
667 | 667 | current_tar_position = 0; |
668 | 668 | /* Open for reading */ |
669 | | if ((tard = tar_open_archive_int (me, name, archive)) == -1) |
| 669 | tard = tar_open_archive_int (me, name, archive); |
| 670 | if (tard == -1) |
670 | 671 | return -1; |
671 | 672 | |
672 | 673 | for (;;) { |
… |
… |
|
772 | 773 | |
773 | 774 | count = MIN(count, FH->ino->st.st_size - FH->pos); |
774 | 775 | |
775 | | if ((count = mc_read (fd, buffer, count)) == -1) ERRNOR (errno, -1); |
| 776 | count = mc_read (fd, buffer, count); |
| 777 | if (count == -1) |
| 778 | ERRNOR (errno, -1); |
776 | 779 | |
777 | 780 | FH->pos += count; |
778 | 781 | return count; |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/undelfs.c mc-4.7.1_new/lib/vfs/mc-vfs/undelfs.c
old
|
new
|
|
206 | 206 | message (D_ERROR, undelfserr, _(" while allocating block buffer ")); |
207 | 207 | goto free_delarray; |
208 | 208 | } |
209 | | if ((retval = ext2fs_open_inode_scan (fs, 0, &scan))) |
| 209 | retval = ext2fs_open_inode_scan (fs, 0, &scan); |
| 210 | if (retval) |
210 | 211 | { |
211 | 212 | message (D_ERROR, undelfserr, _(" open_inode_scan: %d "), retval); |
212 | 213 | goto free_block_buf; |
213 | 214 | } |
214 | | if ((retval = ext2fs_get_next_inode (scan, &ino, &inode))) |
| 215 | retval = ext2fs_get_next_inode (scan, &ino, &inode); |
| 216 | if (retval) |
215 | 217 | { |
216 | 218 | message (D_ERROR, undelfserr, _(" while starting inode scan %d "), retval); |
217 | 219 | goto error_out; |
218 | 220 | } |
219 | | |
220 | 221 | count = 0; |
221 | 222 | while (ino) |
222 | 223 | { |
… |
… |
|
674 | 675 | /* We may use access because ext2 file systems are local */ |
675 | 676 | /* this could be fixed by making an ext2fs io manager to use */ |
676 | 677 | /* our vfs, but that is left as an excercise for the reader */ |
677 | | if ((fd = open (file, O_RDONLY)) == -1) |
| 678 | fd = open (file, O_RDONLY); |
| 679 | if (fd == -1) |
678 | 680 | { |
679 | 681 | message (D_ERROR, undelfserr, _(" Cannot open file %s "), file); |
680 | 682 | g_free (f); |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/utilvfs.c mc-4.7.1_new/lib/vfs/mc-vfs/utilvfs.c
old
|
new
|
|
233 | 233 | if (!str) |
234 | 234 | return 0; |
235 | 235 | |
236 | | if ((pos = strstr (week, str)) != NULL) { |
| 236 | pos = strstr (week, str); |
| 237 | if (pos != NULL) { |
237 | 238 | if (tim != NULL) |
238 | 239 | tim->tm_wday = (pos - week) / 3; |
239 | 240 | return 1; |
… |
… |
|
250 | 251 | if (!str) |
251 | 252 | return 0; |
252 | 253 | |
253 | | if ((pos = strstr (month, str)) != NULL) { |
| 254 | pos = strstr (month, str); |
| 255 | if (pos != NULL) { |
254 | 256 | if (tim != NULL) |
255 | 257 | tim->tm_mon = (pos - month) / 3; |
256 | 258 | return 1; |
… |
… |
|
287 | 289 | { |
288 | 290 | const char *p, *p2; |
289 | 291 | |
290 | | if (!str) |
| 292 | if (str == NULL) |
291 | 293 | return 0; |
292 | 294 | |
293 | | if ((p = strchr (str, ':')) && (p2 = strrchr (str, ':'))) { |
| 295 | p = strchr (str, ':'); |
| 296 | p2 = strrchr (str, ':'); |
| 297 | if (p && p2) { |
294 | 298 | if (p != p2) { |
295 | 299 | if (sscanf |
296 | 300 | (str, "%2d:%2d:%2d", &tim->tm_hour, &tim->tm_min, |
… |
… |
|
619 | 623 | |
620 | 624 | tim.tm_year--; |
621 | 625 | |
622 | | if (l10n || (*t = mktime (&tim)) < 0) |
| 626 | *t = mktime (&tim); |
| 627 | if (l10n || (*t < 0)) |
623 | 628 | *t = 0; |
624 | 629 | return idx; |
625 | 630 | } |
-
diff -urN mc-4.7.1_old/lib/vfs/mc-vfs/vfs.c mc-4.7.1_new/lib/vfs/mc-vfs/vfs.c
old
|
new
|
|
237 | 237 | vfs_die ("vfs_strip_suffix_from_path got NULL: impossible"); |
238 | 238 | |
239 | 239 | p = g_strdup (filename); |
240 | | if (!(semi = strrchr (p, '#'))) |
| 240 | semi = strrchr (p, '#'); |
| 241 | if (semi == NULL) |
241 | 242 | return p; |
242 | 243 | |
243 | 244 | /* Avoid last class (localfs) that would accept any prefix */ |
… |
… |
|
305 | 306 | if (slash) |
306 | 307 | *slash = 0; |
307 | 308 | |
308 | | if ((ret = vfs_prefix_to_class (semi+1))){ |
| 309 | ret = vfs_prefix_to_class (semi + 1); |
| 310 | if (ret != NULL) { |
309 | 311 | if (op) |
310 | 312 | *op = semi + 1; |
311 | 313 | if (inpath) |
… |
… |
|
474 | 476 | errno = EINVAL; |
475 | 477 | return ESTR_FAILURE; |
476 | 478 | } |
477 | | break; |
478 | 479 | default: |
479 | 480 | errno = EINVAL; |
480 | 481 | return ESTR_FAILURE; |
-
diff -urN mc-4.7.1_old/src/background.c mc-4.7.1_new/src/background.c
old
|
new
|
|
148 | 148 | if (pipe (back_comm) == -1) |
149 | 149 | return -1; |
150 | 150 | |
151 | | if ((pid = fork ()) == -1) { |
| 151 | pid = fork (); |
| 152 | if (pid == -1) { |
152 | 153 | int saved_errno = errno; |
153 | 154 | (void) close (comm[0]); |
154 | 155 | (void) close (comm[1]); |
… |
… |
|
156 | 157 | (void) close (back_comm[1]); |
157 | 158 | errno = saved_errno; |
158 | 159 | return -1; |
159 | | } |
160 | | |
161 | | if (pid == 0) { |
| 160 | } else if (pid == 0) { |
162 | 161 | int nullfd; |
163 | 162 | |
164 | 163 | parent_fd = comm[1]; |
… |
… |
|
172 | 171 | close (1); |
173 | 172 | close (2); |
174 | 173 | |
175 | | if ((nullfd = open ("/dev/null", O_RDWR)) != -1) { |
| 174 | nullfd = open ("/dev/null", O_RDWR); |
| 175 | if (nullfd != -1) { |
176 | 176 | while (dup2 (nullfd, 0) == -1 && errno == EINTR); |
177 | 177 | while (dup2 (nullfd, 1) == -1 && errno == EINTR); |
178 | 178 | while (dup2 (nullfd, 2) == -1 && errno == EINTR); |
-
diff -urN mc-4.7.1_old/src/charsets.c mc-4.7.1_new/src/charsets.c
old
|
new
|
|
57 | 57 | char *default_codepage = NULL; |
58 | 58 | |
59 | 59 | fname = concat_dir_and_file (mc_home, CHARSETS_INDEX); |
60 | | if (!(f = fopen (fname, "r"))) { |
| 60 | f = fopen (fname, "r"); |
| 61 | if (f == NULL) { |
61 | 62 | fprintf (stderr, _("Warning: file %s not found\n"), fname); |
62 | 63 | g_free (fname); |
63 | 64 | |
64 | 65 | fname = concat_dir_and_file (mc_home_alt, CHARSETS_INDEX); |
65 | | if (!(f = fopen (fname, "r"))) { |
| 66 | f = fopen (fname, "r"); |
| 67 | if (f == NULL) { |
66 | 68 | fprintf (stderr, _("Warning: file %s not found\n"), fname); |
67 | 69 | g_free (fname); |
68 | 70 | |
-
diff -urN mc-4.7.1_old/src/complete.c mc-4.7.1_new/src/complete.c
old
|
new
|
|
114 | 114 | g_free (filename); |
115 | 115 | g_free (users_dirname); |
116 | 116 | |
117 | | if ((*text) && (temp = strrchr (text, PATH_SEP))){ |
| 117 | temp = strrchr (text, PATH_SEP); |
| 118 | if ((*text) && temp) { |
118 | 119 | filename = g_strdup (++temp); |
119 | 120 | dirname = g_strndup (text, temp - text); |
120 | 121 | } else { |
… |
… |
|
493 | 494 | words = bash_reserved; |
494 | 495 | phase = 0; |
495 | 496 | text_len = strlen (text); |
496 | | if (!path && (path = g_strdup (getenv ("PATH"))) != NULL) { |
497 | | p = path; |
498 | | path_end = strchr (p, 0); |
499 | | while ((p = strchr (p, PATH_ENV_SEP))) { |
500 | | *p++ = 0; |
| 497 | if (path == NULL) { |
| 498 | path = g_strdup (getenv ("PATH")); |
| 499 | if (path != NULL) { |
| 500 | p = path; |
| 501 | path_end = strchr (p, 0); |
| 502 | while ((p = strchr (p, PATH_ENV_SEP))) { |
| 503 | *p++ = 0; |
| 504 | } |
501 | 505 | } |
502 | 506 | } |
503 | 507 | } |
… |
… |
|
560 | 564 | } |
561 | 565 | } |
562 | 566 | } |
563 | | |
564 | 567 | if (found == NULL) { |
565 | 568 | g_free (path); |
566 | 569 | path = NULL; |
567 | | } else if ((p = strrchr (found, PATH_SEP)) != NULL) { |
568 | | char *tmp = found; |
569 | | found = strutils_shell_escape (p + 1); |
570 | | g_free (tmp); |
| 570 | } else { |
| 571 | p = strrchr (found, PATH_SEP); |
| 572 | if (p != NULL) { |
| 573 | char *tmp = found; |
| 574 | found = strutils_shell_escape (p + 1); |
| 575 | g_free (tmp); |
| 576 | } |
571 | 577 | } |
572 | 578 | |
573 | 579 | g_free(text); |
… |
… |
|
1074 | 1080 | Dlg_head *query_dlg; |
1075 | 1081 | WListbox *query_list; |
1076 | 1082 | |
1077 | | for (p=in->completions + 1; *p; count++, p++) |
1078 | | if ((i = str_term_width1 (*p)) > maxlen) |
| 1083 | for (p=in->completions + 1; *p; count++, p++) { |
| 1084 | i = str_term_width1 (*p); |
| 1085 | if (i > maxlen) |
1079 | 1086 | maxlen = i; |
| 1087 | } |
1080 | 1088 | start_x = in->widget.x; |
1081 | 1089 | start_y = in->widget.y; |
1082 | 1090 | if (start_y - 2 >= count) { |
-
diff -urN mc-4.7.1_old/src/editor/choosesyntax.c mc-4.7.1_new/src/editor/choosesyntax.c
old
|
new
|
|
78 | 78 | while (names[count++] != NULL); |
79 | 79 | qsort(names, count - 1, sizeof(char*), pstrcmp); |
80 | 80 | |
81 | | if ((syntax = exec_edit_syntax_dialog ((const char**) names)) < 0) { |
| 81 | syntax = exec_edit_syntax_dialog ((const char**) names); |
| 82 | if (syntax < 0) { |
82 | 83 | for (i = 0; names[i]; i++) { |
83 | 84 | g_free (names[i]); |
84 | 85 | } |
-
diff -urN mc-4.7.1_old/src/editor/edit.c mc-4.7.1_new/src/editor/edit.c
old
|
new
|
|
295 | 295 | edit->curs2 = edit->last_byte; |
296 | 296 | buf2 = edit->curs2 >> S_EDIT_BUF_SIZE; |
297 | 297 | edit->utf8 = 0; |
298 | | if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1) { |
| 298 | file = mc_open (filename, O_RDONLY | O_BINARY); |
| 299 | if (file == -1) { |
299 | 300 | GString *errmsg = g_string_new(NULL); |
300 | 301 | g_string_sprintf(errmsg, _(" Cannot open %s for reading "), filename); |
301 | 302 | edit_error_dialog (_("Error"), get_sys_error (errmsg->str)); |
… |
… |
|
521 | 522 | long current = edit->curs1; |
522 | 523 | int vertical_insertion = 0; |
523 | 524 | char *buf; |
524 | | if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1) |
| 525 | file = mc_open (filename, O_RDONLY | O_BINARY); |
| 526 | if (file == -1) |
525 | 527 | return 0; |
526 | 528 | buf = g_malloc0 (TEMP_BUF_LEN); |
527 | 529 | blocklen = mc_read (file, buf, sizeof(VERTICAL_MAGIC)); |
… |
… |
|
1116 | 1118 | return STACK_BOTTOM; |
1117 | 1119 | } |
1118 | 1120 | sp = (sp - 1) & edit->stack_size_mask; |
1119 | | if ((c = edit->undo_stack[sp]) >= 0) { |
| 1121 | c = edit->undo_stack[sp]; |
| 1122 | if (c >= 0) { |
1120 | 1123 | /* edit->undo_stack[sp] = '@'; */ |
1121 | 1124 | edit->stack_pointer = (edit->stack_pointer - 1) & edit->stack_size_mask; |
1122 | 1125 | return c; |
-
diff -urN mc-4.7.1_old/src/editor/editcmd.c mc-4.7.1_new/src/editor/editcmd.c
old
|
new
|
|
277 | 277 | mc_chown (savename, edit->stat1.st_uid, edit->stat1.st_gid); |
278 | 278 | mc_chmod (savename, edit->stat1.st_mode); |
279 | 279 | |
280 | | if ((fd = |
281 | | mc_open (savename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, edit->stat1.st_mode)) == -1) |
| 280 | fd = mc_open (savename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, edit->stat1.st_mode); |
| 281 | if (fd == -1) |
282 | 282 | goto error_save; |
283 | 283 | |
284 | 284 | /* pipe save */ |
285 | | if ((p = edit_get_write_filter (savename, real_filename))) |
| 285 | p = edit_get_write_filter (savename, real_filename); |
| 286 | if (p != NULL) |
286 | 287 | { |
287 | 288 | FILE *file; |
288 | 289 | |
… |
… |
|
599 | 600 | { |
600 | 601 | int file; |
601 | 602 | different_filename = 1; |
602 | | if ((file = mc_open (exp, O_RDONLY | O_BINARY)) != -1) |
| 603 | file = mc_open (exp, O_RDONLY | O_BINARY); |
| 604 | if (file != -1) |
603 | 605 | { |
604 | 606 | /* the file exists */ |
605 | 607 | mc_close (file); |
… |
… |
|
691 | 693 | FILE *fd; |
692 | 694 | int file; |
693 | 695 | filename = concat_dir_and_file (home_dir, EDIT_MACRO_FILE); |
694 | | if ((file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) == -1) |
| 696 | file = open (filename, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); |
| 697 | if (file == -1) |
695 | 698 | { |
696 | 699 | g_free (filename); |
697 | 700 | return 0; |
… |
… |
|
732 | 735 | (void) edit; |
733 | 736 | |
734 | 737 | if (saved_macros_loaded) |
735 | | if ((j = macro_exists (k)) < 0) |
| 738 | { |
| 739 | j = macro_exists (k); |
| 740 | if (j < 0) |
736 | 741 | return 0; |
| 742 | } |
737 | 743 | tmp = concat_dir_and_file (home_dir, EDIT_TEMP_FILE); |
738 | 744 | g = fopen (tmp, "w"); |
739 | 745 | g_free (tmp); |
… |
… |
|
844 | 850 | if (macro_exists (k) < 0) |
845 | 851 | return 0; |
846 | 852 | |
847 | | if ((f = edit_open_macro_file ("r"))) |
| 853 | f = edit_open_macro_file ("r"); |
| 854 | if (f != NULL) |
848 | 855 | { |
849 | 856 | struct macro dummy; |
850 | 857 | do |
… |
… |
|
2081 | 2088 | { |
2082 | 2089 | int len, file; |
2083 | 2090 | |
2084 | | if ((file = |
2085 | | mc_open (filename, O_CREAT | O_WRONLY | O_TRUNC, |
2086 | | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | O_BINARY)) == -1) |
| 2091 | file = mc_open (filename, O_CREAT | O_WRONLY | O_TRUNC, |
| 2092 | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | O_BINARY); |
| 2093 | if (file == -1) |
2087 | 2094 | return 0; |
2088 | 2095 | |
2089 | 2096 | if (column_highlighting) |
-
diff -urN mc-4.7.1_old/src/editor/editlock.c mc-4.7.1_new/src/editor/editlock.c
old
|
new
|
|
152 | 152 | int cnt; |
153 | 153 | static char buf[BUF_SIZE]; |
154 | 154 | |
155 | | if ((cnt = readlink (lockfname, buf, BUF_SIZE - 1)) == -1 || !*buf) |
| 155 | cnt = readlink (lockfname, buf, BUF_SIZE - 1); |
| 156 | if (cnt == -1 || !*buf) |
156 | 157 | return NULL; |
157 | 158 | buf[cnt] = '\0'; |
158 | 159 | return buf; |
-
diff -urN mc-4.7.1_old/src/editor/syntax.c mc-4.7.1_new/src/editor/syntax.c
old
|
new
|
|
141 | 141 | int argc; |
142 | 142 | |
143 | 143 | while (*argv && argv < argv_end) { |
144 | | if ((t = g_tree_lookup (defines, *argv))) { |
| 144 | t = g_tree_lookup (defines, *argv); |
| 145 | if (t != NULL) { |
145 | 146 | int count = 0; |
146 | 147 | |
147 | 148 | /* Count argv array members */ |
… |
… |
|
304 | 305 | long end = 0; |
305 | 306 | struct syntax_rule _rule = rule; |
306 | 307 | |
307 | | if (!(c = edit_get_byte (edit, i))) |
| 308 | c = edit_get_byte (edit, i); |
| 309 | if (!c) |
308 | 310 | return rule; |
309 | 311 | is_end = (rule.end == (unsigned char) i); |
310 | 312 | |
… |
… |
|
322 | 324 | if (_rule.context && !_rule.keyword) { |
323 | 325 | long e; |
324 | 326 | r = edit->rules[_rule.context]; |
325 | | if (r->first_right == c && !(rule.border & RULE_ON_RIGHT_BORDER) && (e = compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) > 0) { |
| 327 | e = compare_word_to_right (edit, i, r->right, |
| 328 | r->whole_word_chars_left, |
| 329 | r->whole_word_chars_right, |
| 330 | r->line_start_right); |
| 331 | if (r->first_right == c && !(rule.border & RULE_ON_RIGHT_BORDER) && e > 0) { |
326 | 332 | _rule.end = e; |
327 | 333 | found_right = 1; |
328 | 334 | _rule.border = RULE_ON_RIGHT_BORDER; |
… |
… |
|
383 | 389 | _rule.context = _rule._context; |
384 | 390 | contextchanged = 1; |
385 | 391 | _rule.keyword = 0; |
386 | | if (r->first_right == c && (e = compare_word_to_right (edit, i, r->right, r->whole_word_chars_left, r->whole_word_chars_right, r->line_start_right)) >= end) { |
| 392 | e = compare_word_to_right (edit, i, r->right, |
| 393 | r->whole_word_chars_left, |
| 394 | r->whole_word_chars_right, |
| 395 | r->line_start_right); |
| 396 | if (r->first_right == c && e >= end) { |
387 | 397 | _rule.end = e; |
388 | 398 | found_right = 1; |
389 | 399 | _rule.border = RULE_ON_RIGHT_BORDER; |
… |
… |
|
928 | 938 | |
929 | 939 | if (argc < 3) |
930 | 940 | break_a; |
931 | | if ((argv = g_tree_lookup (edit->defines, key))) { |
| 941 | |
| 942 | argv = g_tree_lookup (edit->defines, key); |
| 943 | if (argv != NULL) |
932 | 944 | mc_defines_destroy (NULL, argv, NULL); |
933 | | } else { |
| 945 | else |
934 | 946 | key = g_strdup (key); |
935 | | } |
| 947 | |
936 | 948 | argv = g_new (char *, argc - 1); |
937 | 949 | g_tree_insert (edit->defines, key, argv); |
938 | 950 | while (*a) { |
… |
… |
|
1067 | 1079 | if (!found && !strcmp (args[0], "include")) { |
1068 | 1080 | if (g) |
1069 | 1081 | continue; |
1070 | | if (!args[1] || !(g = open_include_file (args[1]))) { |
1071 | | result = line; |
1072 | | break; |
| 1082 | if (args[1] == NULL) { |
| 1083 | result = line; |
| 1084 | break; |
| 1085 | } else { |
| 1086 | g = open_include_file (args[1]); |
| 1087 | if (g == NULL) { |
| 1088 | result = line; |
| 1089 | break; |
| 1090 | } |
1073 | 1091 | } |
1074 | 1092 | goto found_type; |
1075 | 1093 | } |
-
diff -urN mc-4.7.1_old/src/ext.c mc-4.7.1_new/src/ext.c
old
|
new
|
|
155 | 155 | if (*lc_data == '{') |
156 | 156 | parameter_found = 1; |
157 | 157 | else { |
158 | | int i = check_format_view (lc_data); |
| 158 | int i1, i2, i3; |
159 | 159 | char *v; |
| 160 | |
| 161 | i1 = check_format_view (lc_data); |
| 162 | i2 = check_format_cd (lc_data); |
| 163 | i3 = check_format_var (lc_data, &v); |
160 | 164 | |
161 | | if (i) { |
162 | | lc_data += i - 1; |
| 165 | if (i1) { |
| 166 | lc_data += i1 - 1; |
163 | 167 | run_view = 1; |
164 | | } else if ((i = check_format_cd (lc_data)) > 0) { |
| 168 | } else if (i2 > 0) { |
165 | 169 | is_cd = 1; |
166 | 170 | quote_func = fake_name_quote; |
167 | 171 | do_local_copy = 0; |
168 | 172 | p = buffer; |
169 | | lc_data += i - 1; |
170 | | } else if ((i = check_format_var (lc_data, &v)) > 0 && v) { |
| 173 | lc_data += i2 - 1; |
| 174 | } else if (i3 > 0 && v) { |
171 | 175 | fputs (v, cmd_file); |
172 | 176 | g_free (v); |
173 | | lc_data += i; |
| 177 | lc_data += i3; |
174 | 178 | } else { |
175 | 179 | char *text; |
176 | 180 | |
-
diff -urN mc-4.7.1_old/src/file.c mc-4.7.1_new/src/file.c
old
|
new
|
|
1092 | 1092 | |
1093 | 1093 | if (!ctx->do_append) { |
1094 | 1094 | if (S_ISLNK (src_stats.st_mode) && ctx->stable_symlinks) { |
1095 | | if ((return_status = make_symlink (ctx, s, d)) == FILE_CONT) { |
| 1095 | return_status = make_symlink (ctx, s, d); |
| 1096 | if (return_status == FILE_CONT) { |
1096 | 1097 | goto retry_src_remove; |
1097 | 1098 | } else |
1098 | 1099 | return return_status; |
-
diff -urN mc-4.7.1_old/src/filenot.c mc-4.7.1_new/src/filenot.c
old
|
new
|
|
76 | 76 | q = vfs_canon (p); |
77 | 77 | g_free (p); |
78 | 78 | |
79 | | if (!(result = my_mkdir_rec (q, mode))) |
| 79 | result = my_mkdir_rec (q, mode); |
| 80 | if (result == 0) |
80 | 81 | result = mc_mkdir (s, mode); |
81 | 82 | |
82 | 83 | g_free (q); |
-
diff -urN mc-4.7.1_old/src/hotlist.c mc-4.7.1_new/src/hotlist.c
old
|
new
|
|
1272 | 1272 | break; |
1273 | 1273 | case '"': |
1274 | 1274 | while ((c = getc (hotlist_file)) != EOF && c != '"') { |
1275 | | if (c == '\\') |
1276 | | if ((c = getc (hotlist_file)) == EOF){ |
| 1275 | if (c == '\\') { |
| 1276 | c = getc (hotlist_file); |
| 1277 | if (c == EOF) { |
1277 | 1278 | g_string_free (tkn_buf, TRUE); |
1278 | 1279 | return TKN_EOF; |
1279 | 1280 | } |
| 1281 | } |
1280 | 1282 | g_string_append_c (tkn_buf, c == '\n' ? ' ' : c); |
1281 | 1283 | } |
1282 | 1284 | if (c == EOF) |
… |
… |
|
1285 | 1287 | ret = TKN_STRING; |
1286 | 1288 | break; |
1287 | 1289 | case '\\': |
1288 | | if ((c = getc (hotlist_file)) == EOF){ |
| 1290 | c = getc (hotlist_file); |
| 1291 | if (c == EOF) { |
1289 | 1292 | g_string_free (tkn_buf, TRUE); |
1290 | 1293 | return TKN_EOF; |
1291 | 1294 | } |
… |
… |
|
1323 | 1326 | } |
1324 | 1327 | |
1325 | 1328 | #define CHECK_TOKEN(_TKN_) \ |
1326 | | if ((tkn = hot_next_token ()) != _TKN_) { \ |
| 1329 | tkn = hot_next_token (); \ |
| 1330 | if (tkn != _TKN_) { \ |
1327 | 1331 | hotlist_state.readonly = 1; \ |
1328 | 1332 | hotlist_state.file_error = 1; \ |
1329 | 1333 | while (tkn != TKN_EOL && tkn != TKN_EOF) \ |
… |
… |
|
1473 | 1477 | */ |
1474 | 1478 | hotlist->directory = g_strdup ("Hotlist"); |
1475 | 1479 | |
1476 | | if ((hotlist_file = fopen (hotlist_file_name, "r")) == 0) { |
| 1480 | hotlist_file = fopen (hotlist_file_name, "r"); |
| 1481 | if (hotlist_file == NULL) { |
1477 | 1482 | int result; |
1478 | 1483 | |
1479 | 1484 | load_group (hotlist); |
… |
… |
|
1575 | 1580 | if (!hotlist_state.readonly && hotlist_state.modified && hotlist_file_name) { |
1576 | 1581 | mc_util_make_backup_if_possible (hotlist_file_name, ".bak"); |
1577 | 1582 | |
1578 | | if ((hotlist_file = fopen (hotlist_file_name, "w")) != 0) { |
| 1583 | hotlist_file = fopen (hotlist_file_name, "w"); |
| 1584 | if (hotlist_file != NULL) { |
1579 | 1585 | hot_save_group (hotlist); |
1580 | 1586 | fclose (hotlist_file); |
1581 | 1587 | stat (hotlist_file_name, &stat_buf); |
-
diff -urN mc-4.7.1_old/src/main.c mc-4.7.1_new/src/main.c
old
|
new
|
|
436 | 436 | get_parent_dir_name (const char *cwd, const char *lwd) |
437 | 437 | { |
438 | 438 | const char *p; |
439 | | if (strlen (lwd) > strlen (cwd)) |
440 | | if ((p = strrchr (lwd, PATH_SEP)) && !strncmp (cwd, lwd, p - lwd) && |
441 | | ((gsize)strlen (cwd) == (gsize) p - (gsize) lwd || (p == lwd && cwd[0] == PATH_SEP && |
442 | | cwd[1] == '\0'))) { |
| 439 | if (strlen (lwd) > strlen (cwd)) { |
| 440 | p = strrchr (lwd, PATH_SEP); |
| 441 | if (p == NULL) |
| 442 | return NULL; |
| 443 | |
| 444 | if (!strncmp (cwd, lwd, p - lwd) |
| 445 | && ((gsize) strlen (cwd) == ((gsize) p - (gsize) lwd) |
| 446 | || (p == lwd && cwd[0] == PATH_SEP && cwd[1] == '\0'))) { |
443 | 447 | return (p + 1); |
444 | 448 | } |
| 449 | } |
445 | 450 | return NULL; |
446 | 451 | } |
447 | 452 | |
-
diff -urN mc-4.7.1_old/src/mountlist.c mc-4.7.1_new/src/mountlist.c
old
|
new
|
|
647 | 647 | |
648 | 648 | if (!getcwd(dir, _POSIX_PATH_MAX)) return (NULL); |
649 | 649 | |
650 | | if ((fd = open(dir, O_RDONLY)) == -1) return (NULL); |
| 650 | fd = open (dir, O_RDONLY); |
| 651 | if (fd == -1) |
| 652 | return (NULL); |
651 | 653 | |
652 | 654 | i = disk_get_entry(fd, &de); |
653 | 655 | |
… |
… |
|
745 | 747 | struct mount_entry *entry; |
746 | 748 | struct fs_usage fs_use; |
747 | 749 | |
748 | | if ((entry = read_filesystem_list(0, 0)) != NULL) |
| 750 | entry = read_filesystem_list (0, 0); |
| 751 | if (entry != NULL) |
749 | 752 | { |
750 | 753 | get_fs_usage(entry->me_mountdir, &fs_use); |
751 | 754 | |
-
diff -urN mc-4.7.1_old/src/subshell.c mc-4.7.1_new/src/subshell.c
old
|
new
|
|
436 | 436 | |
437 | 437 | /* Opening the FIFO as O_RDONLY or O_WRONLY causes deadlock */ |
438 | 438 | |
439 | | if ((subshell_pipe[READ] = open (tcsh_fifo, O_RDWR)) == -1 |
440 | | || (subshell_pipe[WRITE] = |
441 | | open (tcsh_fifo, O_RDWR)) == -1) { |
| 439 | subshell_pipe[READ] = open (tcsh_fifo, O_RDWR); |
| 440 | subshell_pipe[WRITE] = open (tcsh_fifo, O_RDWR); |
| 441 | if (subshell_pipe[READ] == -1 || subshell_pipe[WRITE] == -1) { |
442 | 442 | fprintf (stderr, _("Cannot open named pipe %s\n"), tcsh_fifo); |
443 | 443 | perror (__FILE__": open"); |
444 | 444 | use_subshell = FALSE; |
… |
… |
|
463 | 463 | /* We exit here because, if the process table is full, the */ |
464 | 464 | /* other method of running user commands won't work either */ |
465 | 465 | exit (1); |
466 | | } |
467 | | |
468 | | if (subshell_pid == 0) { /* We are in the child process */ |
| 466 | } else if (subshell_pid == 0) { /* We are in the child process */ |
469 | 467 | init_subshell_child (pty_name); |
470 | 468 | } |
471 | 469 | |
… |
… |
|
1178 | 1176 | pty_name [9] = *ptr2; |
1179 | 1177 | |
1180 | 1178 | /* Try to open master */ |
1181 | | if ((pty_master = open (pty_name, O_RDWR)) == -1) { |
| 1179 | pty_master = open (pty_name, O_RDWR); |
| 1180 | if (pty_master == -1) { |
1182 | 1181 | if (errno == ENOENT) /* Different from EIO */ |
1183 | 1182 | return -1; /* Out of pty devices */ |
1184 | 1183 | else |
… |
… |
|
1209 | 1208 | /* chown (pty_name, getuid (), group_info->gr_gid); FIXME */ |
1210 | 1209 | /* chmod (pty_name, S_IRUSR | S_IWUSR | S_IWGRP); FIXME */ |
1211 | 1210 | } |
1212 | | if ((pty_slave = open (pty_name, O_RDWR)) == -1) |
| 1211 | pty_slave = open (pty_name, O_RDWR); |
| 1212 | if (pty_slave == -1) |
1213 | 1213 | fprintf (stderr, "open (pty_name, O_RDWR): %s\r\n", pty_name); |
1214 | 1214 | fcntl(pty_slave, F_SETFD, FD_CLOEXEC); |
1215 | 1215 | return pty_slave; |
-
diff -urN mc-4.7.1_old/src/treestore.c mc-4.7.1_new/src/treestore.c
old
|
new
|
|
375 | 375 | name = g_build_filename (home_dir, MC_USERCONF_DIR, MC_TREESTORE_FILE, NULL); |
376 | 376 | mc_util_make_backup_if_possible (name, ".tmp"); |
377 | 377 | |
378 | | if ((retval = tree_store_save_to(name)) != 0) { |
| 378 | retval = tree_store_save_to (name); |
| 379 | if (retval != 0) { |
379 | 380 | mc_util_restore_from_backup_if_possible (name, ".tmp"); |
380 | 381 | g_free(name); |
381 | 382 | return retval; |
-
diff -urN mc-4.7.1_old/src/user.c mc-4.7.1_new/src/user.c
old
|
new
|
|
301 | 301 | *block = 0; |
302 | 302 | for (i = 0; i < panel->count; i++) |
303 | 303 | if (panel->dir.list[i].f.marked) { |
304 | | strcat (block, tmp = |
305 | | (*quote_func) (panel->dir.list[i].fname, 0)); |
| 304 | tmp = (*quote_func) (panel->dir.list[i].fname, 0); |
| 305 | strcat (block, tmp); |
306 | 306 | g_free (tmp); |
307 | 307 | strcat (block, " "); |
308 | 308 | if (c_lc == 'u') |
… |
… |
|
784 | 784 | } |
785 | 785 | } |
786 | 786 | |
787 | | if ((data = load_file (menu)) == NULL){ |
| 787 | data = load_file (menu); |
| 788 | if (data == NULL) { |
788 | 789 | message (D_ERROR, MSG_ERROR, _(" Cannot open file %s \n %s "), |
789 | 790 | menu, unix_error_string (errno)); |
790 | 791 | g_free (menu); |
-
diff -urN mc-4.7.1_old/src/viewer/datasource.c mc-4.7.1_new/src/viewer/datasource.c
old
|
new
|
|
373 | 373 | mcview_close_datasource (view); |
374 | 374 | |
375 | 375 | open_error_pipe (); |
376 | | if ((fp = popen (command, "r")) == NULL) |
| 376 | fp = popen (command, "r"); |
| 377 | if (fp == NULL) |
377 | 378 | { |
378 | 379 | /* Avoid two messages. Message from stderr has priority. */ |
379 | 380 | mcview_display (view); |
-
diff -urN mc-4.7.1_old/src/viewer/mcviewer.c mc-4.7.1_new/src/viewer/mcviewer.c
old
|
new
|
|
347 | 347 | else if (file != NULL && file[0] != '\0') |
348 | 348 | { |
349 | 349 | /* Open the file */ |
350 | | if ((fd = mc_open (file, O_RDONLY | O_NONBLOCK)) == -1) |
| 350 | fd = mc_open (file, O_RDONLY | O_NONBLOCK); |
| 351 | if (fd == -1) |
351 | 352 | { |
352 | 353 | g_snprintf (tmp, sizeof (tmp), _(" Cannot open \"%s\"\n %s "), |
353 | 354 | file, unix_error_string (errno)); |