FreeBSD Bugzilla – Attachment 14885 Details for
Bug 27803
Enhancement to sort(1)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 1.83 KB, created by
Pete Carah
on 2001-06-01 00:10:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Pete Carah
Created:
2001-06-01 00:10:03 UTC
Size:
1.83 KB
patch
obsolete
>diff -c /usr/src/gnu/usr.bin/sort/sort.c sort/sort.c >*** /usr/src/gnu/usr.bin/sort/sort.c Sun Apr 8 02:21:56 2001 >--- sort/sort.c Thu May 31 15:55:47 2001 >*************** >*** 38,43 **** >--- 38,48 ---- > #include "error.h" > #include "xstrtod.h" > >+ /* added for -I - uses inet_addr and ntohl macros */ >+ #include <sys/socket.h> >+ #include <netinet/in.h> >+ #include <arpa/inet.h> >+ > #ifdef HAVE_LIMITS_H > #include <limits.h> > #else >*************** >*** 99,104 **** >--- 104,110 ---- > int skipsblanks; /* Skip leading white space at start. */ > int eword; /* Zero-origin first word after field. */ > int echar; /* Additional characters in field. */ >+ int ipaddr; /* field is an IP address. */ > int skipeblanks; /* Skip trailing white space at finish. */ > int *ignore; /* Boolean array of characters to ignore. */ > char *translate; /* Translation applied to characters. */ >*************** >*** 1076,1081 **** >--- 1082,1111 ---- > return key->reverse ? -diff : diff; > continue; > } >+ else if (key->ipaddr) >+ { >+ unsigned long a, b; >+ >+ if (*lima || *limb) >+ { >+ char savea = *lima, saveb = *limb; >+ *lima = *limb = '\0'; >+ a = ntohl(inet_addr(texta)); >+ b = ntohl(inet_addr(textb)); >+ *lima = savea; >+ *limb = saveb; >+ } >+ else >+ { >+ a = ntohl(inet_addr(texta)); >+ b = ntohl(inet_addr(textb)); >+ } >+ >+ if (a > b) return key->reverse ? -1 : 1; >+ else if (b > a) return key->reverse ? 1 : -1; >+ >+ continue; >+ } > else if (key->month) > { > diff = getmonth (texta, lena) - getmonth (textb, lenb); >*************** >*** 1701,1706 **** >--- 1731,1740 ---- > break; > case 'i': > key->ignore = nonprinting; >+ break; >+ case 'I': >+ key->ipaddr = 1; >+ key->skipsblanks = key->skipeblanks = 1; > break; > case 'M': > key->month = 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27803
: 14885