comparison src/os_unix.c @ 26877:06a137af96f8 v8.2.3967

patch 8.2.3967: error messages are spread out Commit: https://github.com/vim/vim/commit/460ae5dfca31fa627531c263184849976755cf6b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jan 1 14:19:49 2022 +0000 patch 8.2.3967: error messages are spread out Problem: Error messages are spread out. Solution: Move more errors to errors.h.
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Jan 2022 15:30:05 +0100
parents 3c1dcb63f579
children d4e61d61afd9
comparison
equal deleted inserted replaced
26876:601a973ac16c 26877:06a137af96f8
2700 } 2700 }
2701 else 2701 else
2702 #endif 2702 #endif
2703 l = mch_chdir((char *)olddir); 2703 l = mch_chdir((char *)olddir);
2704 if (l != 0) 2704 if (l != 0)
2705 emsg(_(e_prev_dir)); 2705 emsg(_(e_cannot_go_back_to_previous_directory));
2706 } 2706 }
2707 #ifdef HAVE_FCHDIR 2707 #ifdef HAVE_FCHDIR
2708 if (fd >= 0) 2708 if (fd >= 0)
2709 close(fd); 2709 close(fd);
2710 #endif 2710 #endif
5526 char_u *fname = options->jo_io_name[PART_IN]; 5526 char_u *fname = options->jo_io_name[PART_IN];
5527 5527
5528 fd_in[0] = mch_open((char *)fname, O_RDONLY, 0); 5528 fd_in[0] = mch_open((char *)fname, O_RDONLY, 0);
5529 if (fd_in[0] < 0) 5529 if (fd_in[0] < 0)
5530 { 5530 {
5531 semsg(_(e_notopen), fname); 5531 semsg(_(e_cant_open_file_str), fname);
5532 goto failed; 5532 goto failed;
5533 } 5533 }
5534 } 5534 }
5535 else 5535 else
5536 // When writing buffer lines to the input don't use the pty, so that 5536 // When writing buffer lines to the input don't use the pty, so that
5544 char_u *fname = options->jo_io_name[PART_OUT]; 5544 char_u *fname = options->jo_io_name[PART_OUT];
5545 5545
5546 fd_out[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0644); 5546 fd_out[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0644);
5547 if (fd_out[1] < 0) 5547 if (fd_out[1] < 0)
5548 { 5548 {
5549 semsg(_(e_notopen), fname); 5549 semsg(_(e_cant_open_file_str), fname);
5550 goto failed; 5550 goto failed;
5551 } 5551 }
5552 } 5552 }
5553 else if (!use_null_for_out && pty_master_fd < 0 && pipe(fd_out) < 0) 5553 else if (!use_null_for_out && pty_master_fd < 0 && pipe(fd_out) < 0)
5554 goto failed; 5554 goto failed;
5558 char_u *fname = options->jo_io_name[PART_ERR]; 5558 char_u *fname = options->jo_io_name[PART_ERR];
5559 5559
5560 fd_err[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0600); 5560 fd_err[1] = mch_open((char *)fname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
5561 if (fd_err[1] < 0) 5561 if (fd_err[1] < 0)
5562 { 5562 {
5563 semsg(_(e_notopen), fname); 5563 semsg(_(e_cant_open_file_str), fname);
5564 goto failed; 5564 goto failed;
5565 } 5565 }
5566 } 5566 }
5567 else if (!use_out_for_err && !use_null_for_err 5567 else if (!use_out_for_err && !use_null_for_err
5568 && pty_master_fd < 0 && pipe(fd_err) < 0) 5568 && pty_master_fd < 0 && pipe(fd_err) < 0)
6625 /* 6625 /*
6626 * get a name for the temp file 6626 * get a name for the temp file
6627 */ 6627 */
6628 if ((tempname = vim_tempname('o', FALSE)) == NULL) 6628 if ((tempname = vim_tempname('o', FALSE)) == NULL)
6629 { 6629 {
6630 emsg(_(e_notmp)); 6630 emsg(_(e_cant_get_temp_file_name));
6631 return FAIL; 6631 return FAIL;
6632 } 6632 }
6633 6633
6634 /* 6634 /*
6635 * Let the shell expand the patterns and write the result into the temp 6635 * Let the shell expand the patterns and write the result into the temp
6886 fclose(fd); 6886 fclose(fd);
6887 mch_remove(tempname); 6887 mch_remove(tempname);
6888 if (i != (int)len) 6888 if (i != (int)len)
6889 { 6889 {
6890 // unexpected read error 6890 // unexpected read error
6891 semsg(_(e_notread), tempname); 6891 semsg(_(e_cant_read_file_str), tempname);
6892 vim_free(tempname); 6892 vim_free(tempname);
6893 vim_free(buffer); 6893 vim_free(buffer);
6894 return FAIL; 6894 return FAIL;
6895 } 6895 }
6896 vim_free(tempname); 6896 vim_free(tempname);
7592 # endif 7592 # endif
7593 } 7593 }
7594 7594
7595 if (!success) 7595 if (!success)
7596 { 7596 {
7597 semsg(_(e_libcall), funcname); 7597 semsg(_(e_library_call_failed_for_str), funcname);
7598 return FAIL; 7598 return FAIL;
7599 } 7599 }
7600 7600
7601 return OK; 7601 return OK;
7602 } 7602 }