show_usage();
}
src_stream = xfopen(argv[1], "r");
- save_name = strdup(argv[1]);
+ save_name = xstrdup(argv[1]);
save_name_ptr = strrchr(save_name, '.');
if (save_name_ptr == NULL) {
return(FALSE);
if (argv[optind] == NULL || strcmp(argv[optind], "-") == 0) {
flags |= gunzip_to_stdout;
} else {
- if_name = strdup(argv[optind]);
+ if_name = xstrdup(argv[optind]);
/* Open input file */
in_file = xfopen(if_name, "r");
*/
static int get_address(struct sed_cmd *sed_cmd, const char *str, int *linenum, regex_t **regex)
{
- char *my_str = strdup(str);
+ char *my_str = xstrdup(str);
int idx = 0;
char olddelimiter;
olddelimiter = sed_cmd->delimiter;
*/
static const char vi_Version[] =
- "$Id: vi.c,v 1.16 2001/10/24 04:59:23 andersen Exp $";
+ "$Id: vi.c,v 1.17 2001/11/12 16:57:26 kraai Exp $";
/*
* To compile for standalone use:
editing = 1; // 0=exit, 1=one file, 2+ =many files
if (cfn != 0)
free(cfn);
- cfn = (Byte *) strdup(argv[optind]);
+ cfn = (Byte *) xstrdup(argv[optind]);
edit_file(cfn);
}
}
// Stuff the last_modifying_cmd back into stdin
// and let it be re-executed.
if (last_modifying_cmd != 0) {
- ioq = ioq_start = (Byte *) strdup((char *) last_modifying_cmd);
+ ioq = ioq_start = (Byte *) xstrdup((char *) last_modifying_cmd);
}
break;
#endif /* CONFIG_FEATURE_VI_DOT_CMD */
if (last_search_pattern != 0) {
free(last_search_pattern);
}
- last_search_pattern = (Byte *) strdup((char *) q);
+ last_search_pattern = (Byte *) xstrdup((char *) q);
goto dc3; // now find the pattern
}
// user changed mind and erased the "/"- do nothing
*q++ = *p;
*q = '\0';
}
- pat = (Byte *) strdup((char *) buf); // save copy of pattern
+ pat = (Byte *) xstrdup((char *) buf); // save copy of pattern
if (*p == '/')
p++;
q = char_search(dot, pat, FORWARD, FULL);
// There is a read-able regular file
// make this the current file
- q = (Byte *) strdup((char *) fn); // save the cfn
+ q = (Byte *) xstrdup((char *) fn); // save the cfn
if (cfn != 0)
free(cfn); // free the old name
cfn = q; // remember new cfn
// user wants a new filename
if (cfn != NULL)
free(cfn);
- cfn = (Byte *) strdup((char *) args);
+ cfn = (Byte *) xstrdup((char *) args);
} else {
// user wants file status info
edit_status();
refresh(FALSE);
if (obufp != NULL)
free(obufp);
- obufp = (Byte *) strdup((char *) buf);
+ obufp = (Byte *) xstrdup((char *) buf);
return (obufp);
}
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.74 2001/10/24 04:59:54 andersen Exp $"
+#ident "$Id: insmod.c,v 1.75 2001/11/12 16:57:26 kraai Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.74 2001/10/24 04:59:54 andersen Exp $"
+#ident "$Id: insmod.c,v 1.75 2001/11/12 16:57:26 kraai Exp $"
/* The relocatable object is manipulated using elfin types. */
if (fullname[0] == '\0')
return (FALSE);
else {
- char *tmp, *tmp1 = strdup(filename);
+ char *tmp, *tmp1 = xstrdup(filename);
tmp = get_last_path_component(tmp1);
if (strcmp(tmp, fullname) == 0) {
free(tmp1);
vpp = hashvar(ip->text);
vp->next = *vpp;
*vpp = vp;
- vp->text = strdup(ip->text);
+ vp->text = xstrdup(ip->text);
vp->flags = ip->flags;
vp->func = ip->func;
}
vpp = hashvar("PS1=");
vps1.next = *vpp;
*vpp = &vps1;
- vps1.text = strdup(geteuid() ? "PS1=$ " : "PS1=# ");
+ vps1.text = xstrdup(geteuid() ? "PS1=$ " : "PS1=# ");
vps1.flags = VSTRFIXED|VTEXTFIXED;
}
}
/*
* Copyright (c) 1999 Herbert Xu <herbert@debian.org>
* This file contains code for the times builtin.
- * $Id: ash.c,v 1.35 2001/11/12 16:44:55 kraai Exp $
+ * $Id: ash.c,v 1.36 2001/11/12 16:57:26 kraai Exp $
*/
static int timescmd (int argc, char **argv)
{
/* We need a clean copy, so strsep can mess up the copy while
* we write stuff into the original (in a minute) */
- cmd = cmd_copy = strdup(command);
+ cmd = cmd_copy = xstrdup(command);
*command = '\0';
for (ix = 0, tmpcmd = cmd;
(tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) {
doFork = FALSE;
break;
case 'O':
- logFilePath = strdup(optarg);
+ logFilePath = xstrdup(optarg);
break;
#ifdef CONFIG_FEATURE_REMOTE_LOG
case 'R':
- RemoteHost = strdup(optarg);
+ RemoteHost = xstrdup(optarg);
if ( (p = strchr(RemoteHost, ':'))){
RemotePort = atoi(p+1);
*p = '\0';
strcpy(device, m->mnt_fsname);
strcpy(directory, m->mnt_dir);
- filesystemType = strdup(m->mnt_type);
+ filesystemType = xstrdup(m->mnt_type);
singlemount:
- string_flags = strdup(string_flags);
+ string_flags = xstrdup(string_flags);
rc = EXIT_SUCCESS;
#ifdef CONFIG_NFSMOUNT
if (strchr(device, ':') != NULL)