mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
Merge pull request #1651 from N-R-K/cp_mv
make the cp/mv modification more robust
This commit is contained in:
commit
e013a867da
15
src/nnn.c
15
src/nnn.c
|
@ -728,13 +728,10 @@ static const char * const envs[] = {
|
||||||
#define T_CHANGE 1
|
#define T_CHANGE 1
|
||||||
#define T_MOD 2
|
#define T_MOD 2
|
||||||
|
|
||||||
#ifdef __linux__
|
#define PROGRESS_CP "cpg -giRp"
|
||||||
static char cp[] = "cp -iRp";
|
#define PROGRESS_MV "mvg -gi"
|
||||||
static char mv[] = "mv -i";
|
static char cp[sizeof PROGRESS_CP] = "cp -iRp";
|
||||||
#else
|
static char mv[sizeof PROGRESS_MV] = "mv -i";
|
||||||
static char cp[] = "cp -iRp";
|
|
||||||
static char mv[] = "mv -i";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Archive commands */
|
/* Archive commands */
|
||||||
static char * const archive_cmd[] = {"atool -a", "bsdtar -acvf", "zip -r", "tar -acvf"};
|
static char * const archive_cmd[] = {"atool -a", "bsdtar -acvf", "zip -r", "tar -acvf"};
|
||||||
|
@ -8588,8 +8585,8 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
cp[2] = cp[5] = mv[2] = mv[5] = 'g'; /* cp -iRp -> cpg -giRp */
|
memcpy(cp, PROGRESS_CP, sizeof PROGRESS_CP);
|
||||||
cp[4] = mv[4] = '-';
|
memcpy(mv, PROGRESS_MV, sizeof PROGRESS_MV);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
|
|
Loading…
Reference in a new issue