Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 515836 | Differences between
and this patch

Collapse All | Expand All

(-)net-tools-1.60_p20130513023548.orig/hostname.c (-6 / +8 lines)
Lines 220-230 static void showhname(char *hname, int c Link Here
220
    case 'f':
220
    case 'f':
221
	printf("%s\n", hp->h_name);
221
	printf("%s\n", hp->h_name);
222
	break;
222
	break;
223
    case 's':
224
	if (p != NULL)
225
	    *p = '\0';
226
	printf("%s\n", hp->h_name);
227
	break;
228
    }
223
    }
229
}
224
}
230
225
Lines 311-316 int main(int argc, char **argv) Link Here
311
    char myname[MAXHOSTNAMELEN + 1] =
306
    char myname[MAXHOSTNAMELEN + 1] =
312
    {0};
307
    {0};
313
    char *file = NULL;
308
    char *file = NULL;
309
    char *p;
314
310
315
    static const struct option long_options[] =
311
    static const struct option long_options[] =
316
    {
312
    {
Lines 412-418 int main(int argc, char **argv) Link Here
412
	if (!type)
408
	if (!type)
413
	    printf("%s\n", myname);
409
	    printf("%s\n", myname);
414
	else
410
	else
415
	    showhname(myname, type);
411
		if (type == 's') {
412
			if (p = strchr(myname, '.'))
413
				*p = '\0';
414
			printf("%s\n", myname);
415
		}
416
		else
417
			showhname(myname, type);
416
	break;
418
	break;
417
    case 3:
419
    case 3:
418
	if (file) {
420
	if (file) {

Return to bug 515836