diff options
author | ZyX <kp-pav@yandex.ru> | 2018-04-09 10:23:11 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2018-04-10 01:12:38 +0300 |
commit | ef57cd81fe008adea7021410bb2a7ed925527cdc (patch) | |
tree | 09dfcf1a8fb3b18a390b0258e8a2f34072332f20 /src/nvim/diff.c | |
parent | 5acda0357661af0c50e4fa2b8825e9c3678ca013 (diff) | |
download | rneovim-ef57cd81fe008adea7021410bb2a7ed925527cdc.tar.gz rneovim-ef57cd81fe008adea7021410bb2a7ed925527cdc.tar.bz2 rneovim-ef57cd81fe008adea7021410bb2a7ed925527cdc.zip |
diff: Fix PVS/V547: remove no longer needed OOM handler
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 0ee1c3815d..f9e40ed06f 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -859,9 +859,9 @@ void ex_diffpatch(exarg_T *eap) char_u *esc_name = NULL; #ifdef UNIX - char_u dirbuf[MAXPATHL]; - char_u *fullname = NULL; + char *fullname = NULL; #endif + // We need two temp file names. // Name of original temp file. char_u *tmp_orig = vim_tempname(); @@ -881,21 +881,17 @@ void ex_diffpatch(exarg_T *eap) #ifdef UNIX // Get the absolute path of the patchfile, changing directory below. - fullname = (char_u *)FullName_save((char *)eap->arg, false); -#endif - + fullname = FullName_save((char *)eap->arg, false); esc_name = vim_strsave_shellescape( -#ifdef UNIX - fullname != NULL ? fullname : + (fullname != NULL ? (char_u *)fullname : eap->arg), true, true); +#else + esc_name = vim_strsave_shellescape(eap->arg, true, true); #endif - eap->arg, true, true); - if (esc_name == NULL) { - goto theend; - } size_t buflen = STRLEN(tmp_orig) + STRLEN(esc_name) + STRLEN(tmp_new) + 16; buf = xmalloc(buflen); #ifdef UNIX + char_u dirbuf[MAXPATHL]; // Temporarily chdir to /tmp, to avoid patching files in the current // directory when the patch file contains more than one patch. When we // have our own temp dir use that instead, it will be cleaned up when we @@ -918,7 +914,7 @@ void ex_diffpatch(exarg_T *eap) // Use 'patchexpr' to generate the new file. #ifdef UNIX eval_patch((char *)tmp_orig, - (char *)(fullname != NULL ? fullname : eap->arg), + (fullname != NULL ? fullname : (char *)eap->arg), (char *)tmp_new); #else eval_patch((char *)tmp_orig, (char *)eap->arg, (char *)tmp_new); |