net-tools/net-tools-1.60-netstat-p-basename.patch
2011-12-06 19:15:09 +01:00

22 lines
816 B
Diff

diff -up net-tools-1.60/netstat.c.p-basename net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.p-basename 2011-12-06 14:54:17.023662287 +0100
+++ net-tools-1.60/netstat.c 2011-12-06 14:56:27.852026709 +0100
@@ -395,7 +395,7 @@ static void prg_cache_load(void)
{
char line[LINE_MAX],eacces=0;
int procfdlen,fd,cmdllen,lnamelen;
- char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH];
+ char lname[30],cmdlbuf[512],finbuf[PROGNAME_WIDTH],*cmdlpend;
unsigned long inode;
const char *cs,*cmdlp;
DIR *dirproc=NULL,*dirfd=NULL;
@@ -459,6 +459,8 @@ static void prg_cache_load(void)
cmdlp++;
else
cmdlp = cmdlbuf;
+ if ((cmdlpend = strrchr(cmdlp, ':')) != NULL)
+ *cmdlpend = '\0';
}
snprintf(finbuf, sizeof(finbuf), "%s/%s", direproc->d_name, cmdlp);