-/* $Id: out.c,v 1.21 2010/07/21 20:35:03 kristaps Exp $ */
+/* $Id: out.c,v 1.24 2010/08/16 09:37:58 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
return(0);
}
+ /* FIXME: do this in the caller. */
if ((dst->scale = atof(buf)) < 0)
dst->scale = 0;
dst->unit = unit;
break;
}
break;
+ case ('h'):
+ /* FALLTHROUGH */
+ case ('v'):
+ /* FALLTHROUGH */
case ('s'):
- if ('+' == wp[i] || '-' == wp[i])
+ j = 0;
+ if ('+' == wp[i] || '-' == wp[i]) {
i++;
-
- j = ('s' != wp[i - 1]);
+ j = 1;
+ }
switch (wp[i++]) {
case ('('):
case ('\''):
term = '\'';
break;
+ case ('0'):
+ j = 1;
+ /* FALLTHROUGH */
default:
i--;
lim = 1;
}
if ('+' == wp[i] || '-' == wp[i]) {
- if (j++)
+ if (j)
return(i);
i++;
}
- if (0 == j)
- return(i);
break;
case ('['):
*d = DECO_SPECIAL;