Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37583849
en ru br
ALT Linux repos
S:1.0.11-alt3
5.0: 1.0.11-alt1.2
4.1: 1.0.11-alt1.1
4.0: 1.0.11-alt1.1
3.0: 1.0.11-alt1

Group :: Communications
RPM: zelax-pflash

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: zelax-pflash-pflash.c.progname.patch
Download


--- pflash.c.orig	2005-05-31 18:39:49 +0500
+++ pflash.c	2005-06-01 20:19:03 +0500
@@ -653,9 +653,9 @@
 
 
 #ifndef FREE_BSD
-void usage(void) {
+void usage(const char *name) {
     printf("\n");
-    printf("Usage: pflash [pflash-options]\n");
+    printf("Usage: %s [pflash-options]\n", name);
     printf("    [-h|--help|-?]         Print this help.\n");
     printf("    default: enable\n");
     printf("\n");
@@ -670,9 +670,9 @@
     exit(1);
 }
 #else
-void usage(void) {
+void usage(const char *name) {
     printf("\n");
-    printf("Usage: pflash [pflash-options]\n");
+    printf("Usage: %s [pflash-options]\n", name);
     printf("    [-h|-?]         Print this help.\n");
     printf("    default: disable\n");
     printf("\n");
@@ -700,6 +700,12 @@
     int ccc=0,hi_ccc,lo_ccc,new_hi_ccc,new_lo_ccc,i,per_sent=0,offset1 = 0;
     char *line;
 
+    char *name=argv[0];
+    char *nametmp=name;
+
+    while (*nametmp) { 
+	if ( *(nametmp++) == '/' ) name=nametmp; 
+    }
 
 void restart(void) {
     buffer[0]=0x1; buflen=1;
@@ -737,7 +743,7 @@
     switch(opt)
     {
      case 'h':
-      usage();
+      usage(name);
       break;
       
      case 'i':
@@ -764,14 +770,14 @@
       break;
 
      case '?':
-      usage();
+      usage(name);
       break;
 
     default:
       break;
     }
   }
-    if ((opt == -1)&&(keys == 1)) { usage(); }
+    if ((opt == -1)&&(keys == 1)) { usage(name); }
     
     init_sighandler();
     
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin