comparison lib-src/gnuclient.c @ 440:8de8e3f6228a r21-2-28

Import from CVS: tag r21-2-28
author cvs
date Mon, 13 Aug 2007 11:33:38 +0200
parents 3ecd8885ac67
children abe6d1db359e
comparison
equal deleted inserted replaced
439:357dd071b03c 440:8de8e3f6228a
289 (var) = argv[i]; \ 289 (var) = argv[i]; \
290 } \ 290 } \
291 over = 1; \ 291 over = 1; \
292 } while (0) 292 } while (0)
293 293
294 /* A strdup immitation. */ 294 /* A strdup imitation. */
295 static char * 295 static char *
296 my_strdup (CONST char *s) 296 my_strdup (CONST char *s)
297 { 297 {
298 char *new = malloc (strlen (s) + 1); 298 char *new_s = (char *) malloc (strlen (s) + 1);
299 if (new) 299 if (new_s)
300 strcpy (new, s); 300 strcpy (new_s, s);
301 return new; 301 return new_s;
302 } 302 }
303 303
304 int 304 int
305 main (int argc, char *argv[]) 305 main (int argc, char *argv[])
306 { 306 {
658 starting_line = 1; 658 starting_line = 1;
659 --i; 659 --i;
660 } 660 }
661 filename_expand (fullpath, argv[i]); 661 filename_expand (fullpath, argv[i]);
662 #ifdef INTERNET_DOMAIN_SOCKETS 662 #ifdef INTERNET_DOMAIN_SOCKETS
663 path = malloc (strlen (remotepath) + strlen (fullpath) + 1); 663 path = (char *) malloc (strlen (remotepath) + strlen (fullpath) + 1);
664 sprintf (path, "%s%s", remotepath, fullpath); 664 sprintf (path, "%s%s", remotepath, fullpath);
665 #else 665 #else
666 path = my_strdup (fullpath); 666 path = my_strdup (fullpath);
667 #endif 667 #endif
668 sprintf (command, "(%d . %s)", starting_line, clean_string (path)); 668 sprintf (command, "(%d . %s)", starting_line, clean_string (path));