chiark
/
gitweb
/
~mdw
/
xtoys
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f227ff2
)
Take advantage of new dynamic string macros.
author
mdw
<mdw>
Fri, 21 May 1999 22:09:19 +0000
(22:09 +0000)
committer
mdw
<mdw>
Fri, 21 May 1999 22:09:19 +0000
(22:09 +0000)
xcatch.c
patch
|
blob
|
blame
|
history
xgetline.c
patch
|
blob
|
blame
|
history
diff --git
a/xcatch.c
b/xcatch.c
index 9a6c636c7241e8fc5bd98952d955afb562bf9486..fd0e0d6fb524f758816338daa804a66a78a8eb18 100644
(file)
--- a/
xcatch.c
+++ b/
xcatch.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: xcatch.c,v 1.
6 1999/05/19 20:41:15
mdw Exp $
+ * $Id: xcatch.c,v 1.
7 1999/05/21 22:09:19
mdw Exp $
*
* Catch input and trap it in an X window
*
*
* Catch input and trap it in an X window
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: xcatch.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: xcatch.c,v $
+ * Revision 1.7 1999/05/21 22:09:19 mdw
+ * Take advantage of new dynamic string macros.
+ *
* Revision 1.6 1999/05/19 20:41:15 mdw
* Track gratuitous change in mdwopt interface.
*
* Revision 1.6 1999/05/19 20:41:15 mdw
* Track gratuitous change in mdwopt interface.
*
@@
-355,7
+358,7
@@
int main(int argc, char *argv[])
if (kid < 0)
die(1, "couldn't fork: %s", strerror(errno));
if (kid == 0) {
if (kid < 0)
die(1, "couldn't fork: %s", strerror(errno));
if (kid == 0) {
- dstr d;
+ dstr d
= DSTR_INIT
;
close(pfd[0]);
if (pfd[1] != STDOUT_FILENO)
close(pfd[0]);
if (pfd[1] != STDOUT_FILENO)
@@
-366,10
+369,10
@@
int main(int argc, char *argv[])
close(pfd[1]);
execvp(argv[optind], argv + optind);
close(pfd[1]);
execvp(argv[optind], argv + optind);
- dstr_create(&d);
dstr_putf(&d, "%s: couldn't run `%s': %s\n",
QUIS, argv[optind], strerror(errno));
write(STDERR_FILENO, d.buf, d.len);
dstr_putf(&d, "%s: couldn't run `%s': %s\n",
QUIS, argv[optind], strerror(errno));
write(STDERR_FILENO, d.buf, d.len);
+ dstr_destroy(&d);
_exit(127);
}
_exit(127);
}
diff --git
a/xgetline.c
b/xgetline.c
index 8f8a8dcd03b96af6ce0966725dd511fb50373eea..322f7aa956db9c93fa36824a04909b48dd0e7b0b 100644
(file)
--- a/
xgetline.c
+++ b/
xgetline.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: xgetline.c,v 1.
9 1999/05/05 18:54:37
mdw Exp $
+ * $Id: xgetline.c,v 1.
10 1999/05/21 22:09:19
mdw Exp $
*
* Fetch a line of text from the user
*
*
* Fetch a line of text from the user
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: xgetline.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: xgetline.c,v $
+ * Revision 1.10 1999/05/21 22:09:19 mdw
+ * Take advantage of new dynamic string macros.
+ *
* Revision 1.9 1999/05/05 18:54:37 mdw
* Keep blank lines out of the history list.
*
* Revision 1.9 1999/05/05 18:54:37 mdw
* Keep blank lines out of the history list.
*
@@
-347,9
+350,8
@@
int main(int argc, char *argv[])
hist = 0;
if (fp) {
hist = 0;
if (fp) {
- dstr d;
+ dstr d
= DSTR_INIT
;
- dstr_create(&d);
while (dstr_putline(&d, fp) != EOF) {
hist = g_list_append(hist, xstrdup(d.buf));
dstr_destroy(&d);
while (dstr_putline(&d, fp) != EOF) {
hist = g_list_append(hist, xstrdup(d.buf));
dstr_destroy(&d);