Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2018 14:26:07 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r469549 - in head/sysutils/ods2: . files
Message-ID:  <201805101426.w4AEQ7rw020931@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Thu May 10 14:26:06 2018
New Revision: 469549
URL: https://svnweb.freebsd.org/changeset/ports/469549

Log:
  sysutils/ods2: New maintainer
  
  - Assign to submitter
  - Fix some issues with
    - trailing spaces and/or tabs (for example: if you enter a COMMAND
      and then enter a few spaces or tabs, then you will get an error)
    - parsing command line
    - some compiler warnings
  - While here simplify DOCS installation
  
  PR:		228100
  Submitted by:	Oleg P. <pzn.unixbsd@gmail.com>

Added:
  head/sysutils/ods2/files/patch-direct.c   (contents, props changed)
Modified:
  head/sysutils/ods2/Makefile
  head/sysutils/ods2/files/patch-ods2.c

Modified: head/sysutils/ods2/Makefile
==============================================================================
--- head/sysutils/ods2/Makefile	Thu May 10 14:24:33 2018	(r469548)
+++ head/sysutils/ods2/Makefile	Thu May 10 14:26:06 2018	(r469549)
@@ -3,11 +3,12 @@
 
 PORTNAME=	ods2
 PORTVERSION=	1.3
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.lugs.ch/~dussuett/
 DISTNAME=	ods2
 
-MAINTAINER=	ports@FreeBSD.org
+MAINTAINER=	pzn.unixbsd@gmail.com
 COMMENT=	Utility for manipulating ODS-2 filesystems
 
 USES=		zip
@@ -29,6 +30,6 @@ do-install:
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-	${INSTALL_DATA} ${PORTDOCS:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Added: head/sysutils/ods2/files/patch-direct.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/ods2/files/patch-direct.c	Thu May 10 14:26:06 2018	(r469549)
@@ -0,0 +1,24 @@
+--- direct.c.orig	2001-08-31 18:01:07 UTC
++++ direct.c
+@@ -136,12 +136,15 @@ int name_match(char *spec,int spec_len,char *dirent,in
+         register char sch = *name;
+         if (sch != '*') {
+             register char ech = *entry;
+-                if (sch != ech) if (toupper(sch) != toupper(ech))
+-                    if (sch == '%') {
+-                        percent = MAT_NE;
+-                    } else {
+-                        break;
+-                    }
++                if (sch != ech) {
++                   if (toupper(sch) != toupper(ech)) {
++                      if (sch == '%') {
++                          percent = MAT_NE;
++                      } else {
++                          break;
++                      }
++                   }
++                }
+         } else {
+             break;
+         }

Modified: head/sysutils/ods2/files/patch-ods2.c
==============================================================================
--- head/sysutils/ods2/files/patch-ods2.c	Thu May 10 14:24:33 2018	(r469548)
+++ head/sysutils/ods2/files/patch-ods2.c	Thu May 10 14:26:06 2018	(r469549)
@@ -1,8 +1,55 @@
 --- ods2.c.orig	2001-09-07 21:17:04 UTC
 +++ ods2.c
-@@ -1094,8 +1094,10 @@ int main(int argc,char *argv[])
+@@ -1076,10 +1076,17 @@ char *getcmd(char *inp, char *prompt)
+ int main(int argc,char *argv[])
+ {
+     char str[2048];
++    char *ptr;
++    int  iargc, i, ilen, len;
++    int cmdline = 0;
+     FILE *atfile = NULL;
++
+     printf(" ODS2 %s\n", MODULE_IDENT);
++    if (argc>1) {   /* if exist argument in the command line TRUE */
++        cmdline = 1;
++        iargc = argc - 1;
++    }
+     while (1) {
+-        char *ptr;
+         if (atfile != NULL) {
+             if (fgets(str,sizeof(str),atfile) == NULL) {
+                 fclose(atfile);
+@@ -1090,18 +1097,50 @@ int main(int argc,char *argv[])
+                 if (ptr != NULL) *ptr = '\0';
+                 printf("$> %s\n",str);
+             }
++        }
++        else if (cmdline) {
++            ptr = str;
++            for ( len=0, ilen=0, i=argc-iargc; i<argc; i++ )
++                if ( *argv[i] == '$' ) {
++                    iargc--;
++                    break;
++                } else {
++                    ilen = strlen(argv[i]);
++                    len +=ilen;
++                    if (len < sizeof(str))  {
++                       strcpy(ptr, argv[i]);
++                       ptr += ilen;
++                       *ptr = ' ';
++                       ptr++; *ptr = '\0';
++                       iargc--;
++                    } else {
++                       printf("%%ODS2-CMD-LINE, len of arguments too long.\n");
++                       break;
++                    }
++                }
++            if (iargc == 0) cmdline = 0; /* if all arguments execute */
++            if (ptr != str) printf("$> %s\n",str);
+         } else {
  #ifdef VMS
- 	    if (getcmd (str, "$> ") == NULL) break;
+-	    if (getcmd (str, "$> ") == NULL) break;
++	  if (getcmd (str, "$> ") == NULL) break;
  #else
 -            printf("$> ");
 -            if (gets(str) == NULL) break;
@@ -11,5 +58,34 @@
 +              break;
 +          str[strlen(str)-1] = '\0'; /* strip newline from str */
  #endif
-         }
+-        }
++        }     /* if - else if - else  */
          ptr = str;
+-        while (*ptr == ' ' || *ptr == '\t') ptr++;
+-        if (strlen(ptr) && *ptr != '!') {
++        while (*ptr == ' ' || *ptr == '\t') ptr++; /*  space and tab */
++        len = strlen(ptr);
++        if (len && *ptr != '!') {
+             if (*ptr == '@') {
++                len--;
++                /* remove trailing spaces and tabs */
++                while (*(ptr+len) == ' ' || *(ptr+len) == '\t') {
++                    *(ptr+len) = '\0';
++                    len--;
++                }
+                 if (atfile != NULL) {
+                     printf("%%ODS2-W-INDIRECT, indirect indirection not permitted\n");
+                 } else {
+@@ -1112,9 +1151,9 @@ int main(int argc,char *argv[])
+                 }
+             } else {
+                 if ((cmdsplit(ptr) & 1) == 0) break;
+-            }
+-        }
+-    }
++            }   /* else */
++        }       /* if   */
++    }   /* while (1) */
+     if (atfile != NULL) fclose(atfile);
+     return 1;
+ }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805101426.w4AEQ7rw020931>