Skip to content

Commit

Permalink
Fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
emartisoft authored May 1, 2024
1 parent 851a3f4 commit 4ecae5c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Install.e
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ MODULE 'window','classes/window',
'reaction/reaction_macros',
'reaction/reaction_lib'

#define VERSION 'Amiget Installer v1.0 (29.03.2024)'
#define VERSION 'Amiget Installer v1.1 (29.04.2024)'

->InstallWindow gadgets
ENUM LAYOUT_5, SPACE_6, LAYOUT_8, SPACE_9, BITMAP_11, BITMAP_12, BITMAP_13,
Expand Down Expand Up @@ -212,7 +212,7 @@ PROC installwindow() HANDLE
LAYOUT_ADDIMAGE, mainGadgets[LABEL_21]:=LabelObject,
GA_ID, LABEL_21,
LABEL_DRAWINFO, gDrawInfo,
LABEL_TEXT, 'Amiget V1.0 (29.03.2024)',
LABEL_TEXT, VERSION,
LABEL_JUSTIFICATION, LJ_CENTER,
LabelEnd,
LayoutEnd,
Expand Down
19 changes: 10 additions & 9 deletions amiget.e
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
->-------------------------------------------<-
-> Amiget v1.0 (29/03/2024)
-> Amiget v1.1 (29/04/2024)
-> Coded by emarti, Murat Ozdemir
->-------------------------------------------<-

OPT OSVERSION=37
OPT PREPROCESS
OPT LARGE

#define VERSION 'Amiget v1.0 (29.03.2024)'
#define VERSION 'Amiget v1.1 (29.04.2024)'

MODULE 'ftpaminet',
'dos/dos',
Expand Down Expand Up @@ -132,17 +132,11 @@ PROC main()
WriteF('\e[1;31;40m\aamisearch\a not found.\e[0;31;40m Try reinstalling \aAmiget\a to fix the problem\n')
JUMP end2
ENDIF
MidStr(searchwords, arg, 3, ALL)
StrCopy(searchwords, TrimStr(searchwords))
IF StrLen(searchwords)<2
WriteF('Insufficient length for search\n')
JUMP end2
ENDIF

-> sort and order
StrCopy(sort, 'n')
StrCopy(ord, 'a')

paramIndex:=2
REPEAT
-> sort by name
IF (paramStr[paramIndex]="n") THEN StrCopy(sort, 'n')
Expand All @@ -158,6 +152,13 @@ PROC main()
IF (paramStr[paramIndex]="z") THEN StrCopy(ord, 'z')
paramIndex++
UNTIL paramIndex > StrLen(paramStr)

MidStr(searchwords, arg, paramIndex, ALL)
StrCopy(searchwords, TrimStr(searchwords))
IF StrLen(searchwords)<2
WriteF('Insufficient length for search\n')
JUMP end2
ENDIF

StringF(searchwords, 'amisearch \s\s \s', sort, ord, searchwords);
prerunamisearch:
Expand Down
14 changes: 6 additions & 8 deletions amisearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ delete #?.o #?.lnk
quit
*/
/*
Amisearch v1.0 (29.03.2024)
Amisearch v1.1 (29.04.2024)
Coded by emarti, Murat Ozdemir
*/

Expand All @@ -30,7 +30,7 @@ quit
#define DARK "darkrow"

#define BUFFER 0x0400
UBYTE *vers = "\0$VER: amisearch 1.0 (29.03.2024) emarti, Murat Ozdemir\r\n\0";
UBYTE *vers = "\0$VER: amisearch 1.1 (29.04.2024) emarti, Murat Ozdemir\r\n\0";

BPTR file, htmlfile;
char **arrline;
Expand Down Expand Up @@ -62,8 +62,6 @@ int main(int argc, char* argv[]) {
time_t t;
struct tm *dt;
char strdate[0xff];
char opt[3];


signal(SIGINT, INThandler);

Expand All @@ -86,8 +84,7 @@ int main(int argc, char* argv[]) {
if (i!=argc-1) strcat(url, "+");
}
//strcat(url, "&start=0");
strcpy(opt, argv[1]);
switch (opt[0])
switch (argv[1][0])
{
case 'n': strcat(url, "&sort=name");break;
case 'p': strcat(url, "&sort=path");break;
Expand All @@ -96,7 +93,7 @@ int main(int argc, char* argv[]) {
default: break;
}

switch (opt[1])
switch (argv[1][1])
{
case 'a': strcat(url, "&ord=no");break;
case 'z': strcat(url, "&ord=DESC");break;
Expand Down Expand Up @@ -124,7 +121,8 @@ int main(int argc, char* argv[]) {
// html->data
htmlfile = Open(htmlfilename, MODE_OLDFILE);
if (htmlfile == NULL) {
printf("HTML file not found\n");
printf("HTML file not found.\n"); // If not HTTP, html file not download
printf("Aminet server protocol may have been changed to HTTPS. Please, try again later.\n");
return -2;
}

Expand Down

0 comments on commit 4ecae5c

Please sign in to comment.