* as/hc08/lkaomf51.c (OutputName): made name unsigned char,
[fw/sdcc] / as / hc08 / lkmain.c
index ae5aff2fa9000276cf832be2c3b93ce566ae4834..14003b7e22d4038e334d01d953413284aec5e6a9 100644 (file)
@@ -375,7 +375,7 @@ char *argv[];
                }
        }
        //JCF:
-       CreateAOMF51();
+       //CreateAOMF51();
 
 #ifdef WIN32T
     Timer(1, "Linker execution time");
@@ -762,6 +762,8 @@ parse()
        char fid[NINPUT];
 
        while ((c = getnb()) != 0) {
+               if ( c == ';')
+                       return(0);
                if ( c == '-') {
                        while (ctype[c=get()] & LETTER) {
                                switch(c) {
@@ -877,6 +879,8 @@ parse()
                                        lkexit(1);
                                }
                        }
+                       if ( c == ';')
+                               return(0);
                } else
                if (ctype[c] & ILL) {
                        fprintf(stderr, "Invalid input");
@@ -1180,7 +1184,7 @@ char *ft;
 
        /*Look backward the name path and get rid of the extension, if any*/
        i=strlen(fn);
-       for(; (fn[i]!='.')&&(fn[i]!='\\')&&(fn[i]!='/')&&(i>=0); i--);
+       for(; (fn[i]!='.')&&(fn[i]!='\\')&&(fn[i]!='/')&&(i>0); i--);
        if( (fn[i]=='.') && strcmp(ft, "lnk") )
        {
                strncpy(fb, fn, i);
@@ -1192,9 +1196,12 @@ char *ft;
        }
 
        /*Add the extension*/
-       strcat(fb, ".");
-       strcat(fb, strlen(ft)?ft:"rel");
-       
+       if (fb[i] != '.')
+       {
+               strcat(fb, ".");
+               strcat(fb, strlen(ft)?ft:"rel");
+       }
+               
        fp = fopen(fb, omode);
        if (fp==NULL)
        {