summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-11-12 16:57:27 +0000
committerMatt Kraai <kraai@debian.org>2001-11-12 16:57:27 +0000
commitc8227639db90c3147ef68f33c98e96b0ab6b01d6 (patch)
treeb704ef3f684a41c7705b5e36dac2127d23d129c4 /editors/vi.c
parent357cfc739ed5f5c00ee46a43820a1d02367e3b38 (diff)
downloadbusybox-w32-c8227639db90c3147ef68f33c98e96b0ab6b01d6.tar.gz
busybox-w32-c8227639db90c3147ef68f33c98e96b0ab6b01d6.tar.bz2
busybox-w32-c8227639db90c3147ef68f33c98e96b0ab6b01d6.zip
Change strdup calls to xstrdup (patch from Steve Merrifield).
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/editors/vi.c b/editors/vi.c
index ddc2edc75..b65c9cf42 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21static const char vi_Version[] = 21static const char vi_Version[] =
22 "$Id: vi.c,v 1.16 2001/10/24 04:59:23 andersen Exp $"; 22 "$Id: vi.c,v 1.17 2001/11/12 16:57:26 kraai Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -385,7 +385,7 @@ extern int vi_main(int argc, char **argv)
385 editing = 1; // 0=exit, 1=one file, 2+ =many files 385 editing = 1; // 0=exit, 1=one file, 2+ =many files
386 if (cfn != 0) 386 if (cfn != 0)
387 free(cfn); 387 free(cfn);
388 cfn = (Byte *) strdup(argv[optind]); 388 cfn = (Byte *) xstrdup(argv[optind]);
389 edit_file(cfn); 389 edit_file(cfn);
390 } 390 }
391 } 391 }
@@ -1085,7 +1085,7 @@ static void do_cmd(Byte c)
1085 // Stuff the last_modifying_cmd back into stdin 1085 // Stuff the last_modifying_cmd back into stdin
1086 // and let it be re-executed. 1086 // and let it be re-executed.
1087 if (last_modifying_cmd != 0) { 1087 if (last_modifying_cmd != 0) {
1088 ioq = ioq_start = (Byte *) strdup((char *) last_modifying_cmd); 1088 ioq = ioq_start = (Byte *) xstrdup((char *) last_modifying_cmd);
1089 } 1089 }
1090 break; 1090 break;
1091#endif /* CONFIG_FEATURE_VI_DOT_CMD */ 1091#endif /* CONFIG_FEATURE_VI_DOT_CMD */
@@ -1102,7 +1102,7 @@ static void do_cmd(Byte c)
1102 if (last_search_pattern != 0) { 1102 if (last_search_pattern != 0) {
1103 free(last_search_pattern); 1103 free(last_search_pattern);
1104 } 1104 }
1105 last_search_pattern = (Byte *) strdup((char *) q); 1105 last_search_pattern = (Byte *) xstrdup((char *) q);
1106 goto dc3; // now find the pattern 1106 goto dc3; // now find the pattern
1107 } 1107 }
1108 // user changed mind and erased the "/"- do nothing 1108 // user changed mind and erased the "/"- do nothing
@@ -1655,7 +1655,7 @@ static Byte *get_one_address(Byte * p, int *addr) // get colon addr, if present
1655 *q++ = *p; 1655 *q++ = *p;
1656 *q = '\0'; 1656 *q = '\0';
1657 } 1657 }
1658 pat = (Byte *) strdup((char *) buf); // save copy of pattern 1658 pat = (Byte *) xstrdup((char *) buf); // save copy of pattern
1659 if (*p == '/') 1659 if (*p == '/')
1660 p++; 1660 p++;
1661 q = char_search(dot, pat, FORWARD, FULL); 1661 q = char_search(dot, pat, FORWARD, FULL);
@@ -1852,7 +1852,7 @@ static void colon(Byte * buf)
1852 1852
1853 // There is a read-able regular file 1853 // There is a read-able regular file
1854 // make this the current file 1854 // make this the current file
1855 q = (Byte *) strdup((char *) fn); // save the cfn 1855 q = (Byte *) xstrdup((char *) fn); // save the cfn
1856 if (cfn != 0) 1856 if (cfn != 0)
1857 free(cfn); // free the old name 1857 free(cfn); // free the old name
1858 cfn = q; // remember new cfn 1858 cfn = q; // remember new cfn
@@ -1905,7 +1905,7 @@ static void colon(Byte * buf)
1905 // user wants a new filename 1905 // user wants a new filename
1906 if (cfn != NULL) 1906 if (cfn != NULL)
1907 free(cfn); 1907 free(cfn);
1908 cfn = (Byte *) strdup((char *) args); 1908 cfn = (Byte *) xstrdup((char *) args);
1909 } else { 1909 } else {
1910 // user wants file status info 1910 // user wants file status info
1911 edit_status(); 1911 edit_status();
@@ -3465,7 +3465,7 @@ static Byte *get_input_line(Byte * prompt) // get input line- use "status line"
3465 refresh(FALSE); 3465 refresh(FALSE);
3466 if (obufp != NULL) 3466 if (obufp != NULL)
3467 free(obufp); 3467 free(obufp);
3468 obufp = (Byte *) strdup((char *) buf); 3468 obufp = (Byte *) xstrdup((char *) buf);
3469 return (obufp); 3469 return (obufp);
3470} 3470}
3471 3471