alias.c (190284) | alias.c (193221) |
---|---|
1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/alias.c 190284 2009-03-22 21:09:22Z stefanf $"); | 39__FBSDID("$FreeBSD: head/bin/sh/alias.c 193221 2009-06-01 10:50:17Z rse $"); |
40 41#include <stdlib.h> 42#include "shell.h" 43#include "output.h" 44#include "error.h" 45#include "memalloc.h" 46#include "mystring.h" 47#include "alias.h" --- 44 unchanged lines hidden (view full) --- 92 * H A C K is that we add a little fluff after the alias value 93 * so that the string will not be exhausted. This is a good 94 * idea ------- ***NOT*** 95 */ 96#ifdef notyet 97 ap->val = savestr(val); 98#else /* hack */ 99 { | 40 41#include <stdlib.h> 42#include "shell.h" 43#include "output.h" 44#include "error.h" 45#include "memalloc.h" 46#include "mystring.h" 47#include "alias.h" --- 44 unchanged lines hidden (view full) --- 92 * H A C K is that we add a little fluff after the alias value 93 * so that the string will not be exhausted. This is a good 94 * idea ------- ***NOT*** 95 */ 96#ifdef notyet 97 ap->val = savestr(val); 98#else /* hack */ 99 { |
100 int len = strlen(val); | 100 size_t len = strlen(val); |
101 ap->val = ckmalloc(len + 2); 102 memcpy(ap->val, val, len); 103 ap->val[len] = ' '; /* fluff */ 104 ap->val[len+1] = '\0'; 105 } 106#endif 107 ap->flag = 0; 108 ap->next = *app; --- 180 unchanged lines hidden --- | 101 ap->val = ckmalloc(len + 2); 102 memcpy(ap->val, val, len); 103 ap->val[len] = ' '; /* fluff */ 104 ap->val[len+1] = '\0'; 105 } 106#endif 107 ap->flag = 0; 108 ap->next = *app; --- 180 unchanged lines hidden --- |