projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This is mmh-0.4
[mmh]
/
uip
/
anno.c
diff --git
a/uip/anno.c
b/uip/anno.c
index
66e62c5
..
1708557
100644
(file)
--- a/
uip/anno.c
+++ b/
uip/anno.c
@@
-53,6
+53,8
@@
static struct swit switches[] = {
{ NULL, 0 }
};
{ NULL, 0 }
};
+char *version=VERSION;
+
/*
** static prototypes
*/
/*
** static prototypes
*/
@@
-181,7
+183,7
@@
main(int argc, char **argv)
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
- folder = getcpy(expandfol(cp));
+ folder = mh_xstrdup(expandfol(cp));
} else if (*cp == '/' || *cp == '.') {
if (file)
adios(EX_USAGE, NULL, "only one file at a time!");
} else if (*cp == '/' || *cp == '.') {
if (file)
adios(EX_USAGE, NULL, "only one file at a time!");
@@
-342,7
+344,7
@@
annolist(char *file, unsigned char *comp, int number)
} while (*field && *field != '-');
} while (*field && *field != '-');
- free(field);
+ mh_free0(&field);
fclose(fp);
return;
fclose(fp);
return;
@@
-478,11
+480,13
@@
dodel(int fd, unsigned char *comp, char *text, FILE *tmp, int number)
** a long path name.
*/
for (n=0, cp=field; (c=getc(fp)) != EOF; *cp++ = c) {
** a long path name.
*/
for (n=0, cp=field; (c=getc(fp)) != EOF; *cp++ = c) {
- if (c == '\n' && (c = getc(fp)) != ' ' &&
- c != '\t') {
- ungetc(c, fp);
+ if (c == '\n') {
+ ungetc((c = getc(fp)), fp);
+ if (c != ' ' && c != '\t') {
+ c = '\n';
+ break;
+ }
c = '\n';
c = '\n';
- break;
}
if (++n >= field_size - 1) {
}
if (++n >= field_size - 1) {
@@
-542,7
+546,7
@@
dodel(int fd, unsigned char *comp, char *text, FILE *tmp, int number)
} while (*field && *field != '-');
} while (*field && *field != '-');
- free(field);
+ mh_free0(&field);
fflush(tmp);
fflush(fp); /* The underlying fd will be closed by lkclose() */
fflush(tmp);
fflush(fp); /* The underlying fd will be closed by lkclose() */