Changes in zwrite.c [f271129:d6c2e03]
Legend:
- Unmodified
- Added
- Removed
-
zwrite.c
rf271129 rd6c2e03 1 1 #include "owl.h" 2 2 3 CALLER_OWN owl_zwrite *owl_zwrite_new (const char *line)3 CALLER_OWN owl_zwrite *owl_zwrite_new_from_line(const char *line) 4 4 { 5 5 owl_zwrite *z = g_new(owl_zwrite, 1); … … 11 11 } 12 12 13 CALLER_OWN owl_zwrite *owl_zwrite_new(int argc, const char *const *argv) 14 { 15 owl_zwrite *z = g_new(owl_zwrite, 1); 16 if (owl_zwrite_create(z, argc, argv) < 0) { 17 owl_zwrite_delete(z); 18 return NULL; 19 } 20 return z; 21 } 22 13 23 G_GNUC_WARN_UNUSED_RESULT int owl_zwrite_create_from_line(owl_zwrite *z, const char *line) 14 24 { 15 int argc , badargs, myargc;25 int argc; 16 26 char **argv; 27 int ret; 28 29 /* parse the command line for options */ 30 argv = owl_parseline(line, &argc); 31 if (argc < 0) { 32 owl_function_error("Unbalanced quotes in zwrite"); 33 return -1; 34 } 35 ret = owl_zwrite_create(z, argc, strs(argv)); 36 g_strfreev(argv); 37 return ret; 38 } 39 40 G_GNUC_WARN_UNUSED_RESULT int owl_zwrite_create(owl_zwrite *z, int argc, const char *const *argv) 41 { 42 int badargs, myargc; 17 43 const char *const *myargv; 18 44 char *msg = NULL; … … 31 57 z->noping=0; 32 58 z->recips = g_ptr_array_new(); 33 z->zwriteline = g_strdup(line); 34 35 /* parse the command line for options */ 36 argv=owl_parseline(line, &argc); 37 myargv=strs(argv); 38 if (argc<0) { 39 owl_function_error("Unbalanced quotes in zwrite"); 40 return(-1); 41 } 42 myargc=argc; 59 z->zwriteline = owl_argv_quote(argc, argv); 60 61 myargc = argc; 62 myargv = argv; 43 63 if (myargc && *(myargv[0])!='-') { 44 64 z->cmd=g_strdup(myargv[0]); … … 119 139 } 120 140 121 g_strfreev(argv);122 123 141 if (badargs) { 124 142 return(-1);
Note: See TracChangeset
for help on using the changeset viewer.