Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/coreutils/dos2unix.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 42  static void convert(char *fn, int conv_t Line 42  static void convert(char *fn, int conv_t
42   i = mkstemp(temp_fn);   i = mkstemp(temp_fn);
43   if (i == -1   if (i == -1
44   || fchmod(i, st.st_mode) == -1   || fchmod(i, st.st_mode) == -1
  || !(out = fdopen(i, "w+"))  
45   ) {   ) {
46   bb_simple_perror_msg_and_die(temp_fn);   bb_simple_perror_msg_and_die(temp_fn);
47   }   }
48     out = xfdopen_for_write(i);
49   }   }
50    
51   while ((i = fgetc(in)) != EOF) {   while ((i = fgetc(in)) != EOF) {
# Line 69  static void convert(char *fn, int conv_t Line 69  static void convert(char *fn, int conv_t
69  }  }
70    
71  int dos2unix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;  int dos2unix_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
72  int dos2unix_main(int argc, char **argv)  int dos2unix_main(int argc UNUSED_PARAM, char **argv)
73  {  {
74   int o, conv_type;   int o, conv_type;
75    
# Line 88  int dos2unix_main(int argc, char **argv) Line 88  int dos2unix_main(int argc, char **argv)
88   if (o)   if (o)
89   conv_type = o;   conv_type = o;
90    
91     argv += optind;
92   do {   do {
93   /* might be convert(NULL) if there is no filename given */   /* might be convert(NULL) if there is no filename given */
94   convert(argv[optind], conv_type);   convert(*argv, conv_type);
95   optind++;   } while (*++argv);
  } while (optind < argc);  
96    
97   return 0;   return 0;
98  }  }

Legend:
Removed from v.983  
changed lines
  Added in v.984