Deleted Added
full compact
spec.c (160083) spec.c (187910)
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 */
29
30#if 0
31#ifndef lint
32static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 6/6/93";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/spec.c 160083 2006-07-03 10:55:22Z maxim $");
36__FBSDID("$FreeBSD: head/usr.sbin/mtree/spec.c 187910 2009-01-30 05:49:27Z kientzle $");
37
38#include <sys/types.h>
39#include <sys/stat.h>
40#include <ctype.h>
41#include <err.h>
42#include <errno.h>
43#include <fts.h>
44#include <grp.h>

--- 204 unchanged lines hidden (view full) ---

249 ip->slink = malloc(strlen(val) + 1);
250 if (ip->slink == NULL)
251 errx(1, "malloc");
252 if (strunvis(ip->slink, val) == -1)
253 errx(1, "symlink %s is ill-encoded", val);
254 break;
255 case F_TIME:
256 ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
37
38#include <sys/types.h>
39#include <sys/stat.h>
40#include <ctype.h>
41#include <err.h>
42#include <errno.h>
43#include <fts.h>
44#include <grp.h>

--- 204 unchanged lines hidden (view full) ---

249 ip->slink = malloc(strlen(val) + 1);
250 if (ip->slink == NULL)
251 errx(1, "malloc");
252 if (strunvis(ip->slink, val) == -1)
253 errx(1, "symlink %s is ill-encoded", val);
254 break;
255 case F_TIME:
256 ip->st_mtimespec.tv_sec = strtoul(val, &ep, 10);
257 if (*ep != '.')
258 errx(1, "line %d: invalid time %s",
259 lineno, val);
260 val = ep + 1;
261 ip->st_mtimespec.tv_nsec = strtoul(val, &ep, 10);
257 if (*ep == '.') {
258 val = ep + 1;
259 ip->st_mtimespec.tv_nsec
260 = strtoul(val, &ep, 10);
261 } else
262 ip->st_mtimespec.tv_nsec = 0;
262 if (*ep)
263 errx(1, "line %d: invalid time %s",
263 if (*ep)
264 errx(1, "line %d: invalid time %s",
264 lineno, val);
265 lineno, val);
265 break;
266 case F_TYPE:
267 switch(*val) {
268 case 'b':
269 if (!strcmp(val, "block"))
270 ip->type = F_BLOCK;
271 break;
272 case 'c':

--- 48 unchanged lines hidden ---
266 break;
267 case F_TYPE:
268 switch(*val) {
269 case 'b':
270 if (!strcmp(val, "block"))
271 ip->type = F_BLOCK;
272 break;
273 case 'c':

--- 48 unchanged lines hidden ---